How to send text to a CKEditor WYSIWYG editor box using Watir-WebDriver

社会主义新天地 提交于 2019-12-04 12:06:36

Firefox doesn't dispatch focus/blur events unless it is in the foreground. The most reliable solution is to always ensure a separate display (or VM) per browser instance. Failing that you may be able to use set the editor's value using Browser#execute_script.

Thanks to Jari's pointer, I ended up executing javascript to update the field reliably:

b.execute_script "CKEDITOR.instances.editor1.setData( 'hello' );"
hemri

Try this:

b.frame(:title => 'Rich text editor, editor1, press ALT 0 for help.').body.send_keys "hello world"

it works for me on OSX and FF3.6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!