0
使用Watir Webdriver我能夠檢測到所見即所得ckeditor存在,但是任何嘗試send_keys
都會輸出空白字符串?使用Watir Webdriver和WYSIWYG
我能夠沒有問題,運行上面的CKEditor的測試:
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"
我然而,其運行我自己的測試這個代碼的問題:
b.frame(:title, "Rich text editor, currentItem.contentText, press ALT 0 for help.").exists?
=> true
b.frame(:title, "Rich text editor, currentItem.contentText, press ALT 0 for help.").send_keys 'text'
=>""
沒有呈現到所見即所得。 網頁上的其他框架允許我編輯文本字段。有什麼想法嗎?
我不想使用execute_script方法,因爲它會使我的測試無效。 – alp2012
爲什麼使用execute_script方法會使測試失效?除非實際開發自己的所見即所得編輯器,否則您不是在測試編輯器,而是可以用它來嚮應用程序添加內容,這是通過execute_script方法實現的? –