Selenium和Firefox:如何关闭"无响应脚本"警告?

Dav*_*ave 12 firefox selenium

我在Mac 10.6.6上使用Selenium Client 2.4.0和Firefox 5.使用WebBackedSeleniumDriver,我正在运行一个导致Firefox警告的"selenium.getEval"命令,

"Warning: Unresponsive script.

A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

Script: resource://fxdriver/modules/utils.js:9161"
Run Code Online (Sandbox Code Playgroud)

"dom.max_script_run_time"about:config的值为"0",应该完全禁用上述对话框.然而,我仍然得到了对话.有没有办法阻止警告对话框出现?

Wla*_*ant 6

dom.max_script_run_time是正确的偏好,但它只适用于网页.浏览器UI(以及像fxdriver这样的扩展是其中的一部分)受首选项的限制dom.max_chrome_script_run_time(默认值为20秒).您也应该将其设置为0.

文档:https://developer.mozilla.org/en/Preferences/Mozilla_preferences_for_uber-geeks#DOM_preferences


Tru*_*ung 5

无论您在配置文件中设置了什么,在启动期间,Selenium都会将这两个值设置为2417483647以尝试绕过浏览器警告.但是,因为该值太大,FF最终忽略它并使用默认值10/20.即使您指向Selenium使用您的配置文件作为模板,也是如此.

我发现解决这个问题的最好方法是指定-timeout nnnn

到Selenium Server启动args.这将设置服务器和客户端(浏览器)超时值.


Bor*_*sky 0

将其设置为一个非常大的数字而不是“20”?