Selenium 和 ckEditor
有谁知道我如何让 ckEditor 与 Selenium 一起工作。 我无法将焦点移到“html 编辑”字段或更改 html 字段的值。
有人有这方面的经验吗?
Does anybody know How I can get the ckEdtior to work with Selenium.
I'm not able to get the focus to the "html edit" field or change the value of the html field.
Does anybody has experience with this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
只是为了完成答案:
我让它工作:
runScript("CKEDITOR.instances['InstanceName'].setData('
testContent
');")
它不适用于 getEval 命令。
Just for completing the anwser:
I got it to work with:
runScript("CKEDITOR.instances['InstanceName'].setData('<p>testContent</p>');")
It did not work with the getEval command.
当我对所见即所得编辑器进行测试时,我必须构建自己的机制来在内容领域工作。通常,它涉及必须设置对象的内部 HTML,然后开始使用工具栏中的页面操纵器。
使用 Selenium 2,您将能够发送击键,以便它们工作得更好、更容易。
When I have had a to test against WYSIWYG editors I have had to build my own mechanism to work in the content area. Normally it involves having to set the inner HTML of object and then start using the page manipulators in the tool bars.
With Selenium 2 you will be able to send keystrokes in so that they work better and a lot easier.
在硒中工作:
Working in Selenium:
我找到了一个对我有用的解决方案。您可以插入 user-extension.js (Options > options > Selenium Core Extension > Browse ),写入以下内容:
这将在 Selenium IDE 的命令选项中添加 insertCKEditor 选项。
I've found a solution that worked for me. You can insert a user-extension.js (Options > options > Selenium Core Extension > Browse ) writing the following:
This will add the insertCKEditor option in the Command options of Selenium IDE.