硒& Firefox:如何关闭“无响应的脚本”警告? [英] Selenium & Firefox: How can i turn off "Unresponsive script" warnings?

查看:151
本文介绍了硒& Firefox:如何关闭“无响应的脚本”警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Firefox 10的Mac 10.6.6上使用Selenium Client 2.4.0。使用WebBackedSeleniumDriver,我运行了一个导致Firefox警告的selenium.getEval命令,

I'm using Selenium Client 2.4.0 on Mac 10.6.6 with Firefox 5. Using the WebBackedSeleniumDriver, I'm running a "selenium.getEval" command that causes a Firefox warning,

"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"

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

The value of "dom.max_script_run_time" about:config was "0", which should disable the above dialog altogether. Yet, I still get the dialog. Is there any way to prevent the warning dialog from appearing?

推荐答案

无论您在配置文件中设置了什么, Selenium将这两个值设置为2417483647来尝试绕过浏览器警告。但是,由于值太大,FF最终会忽略它,并使用默认值10/20来代替。这是真的,即使你指出Selenium使用你的个人资料作为模板。

Regardless of what you have setup in your profile, during startup, Selenium sets both values to 2417483647 to try and get around the browser warning. However, because the value is so large, FF ends up ignoring it and using the default value of 10/20 instead. This is true even if you're pointing Selenium to use your profile as the template.

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

The best way I've found to get around this is to specify -timeout nnnn

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

to the Selenium Server startup args. This sets both the server and client (browser) timeout values.

这篇关于硒& Firefox:如何关闭“无响应的脚本”警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆