我有一個使用下面的代碼設置CKEditor框的watir-webdriver腳本,但是這隻適用於Mac OSX上的Firefox,當我專注於屏幕時。例如,如果我關注並讓該腳本在後臺運行,則不會輸入文本(但不會引發異常或錯誤)。如何使用Watir-WebDriver發送文本到CKEditor WYSIWYG編輯框
任何人都知道如何始終確保它被設置?
require "watir-webdriver"
b = Watir::Browser.new :firefox
b.goto "http://ckeditor.com/demo"
b.frame(:title => 'Rich text editor, editor1, press ALT 0 for help.').send_keys "hello world"
(谷歌瀏覽器在Mac OSX確定,但我想對Firefox的運行我測試過)
謝謝,我已成功使用browser.execute_script(「CKEDITOR.instances.editor1.setData('hello');」) –