开发者

Webdriver/FXDriver utils.js causing 'unresponsive script' error in Firefox

I've got some browser tests that run using Watir webdriver and FXDriver and things are generally working ok. However there is one test that loads a lightbox that contains a lot of HTML, and when the tests open this lightbox, Firefox shows a popup complaining that Utils.js line 432 from FXDriver has become an 'unresponsive script' and the test times out. I would rather fix the problem properly than extend the dom.max_script_run_time value, so I looked at the line in question...

goog.string.canonicalizeNewlines = function(a) {
  return a.replace(/(\r\n|\r|\n)/g, "\n")
};

It's pretty obvious why this is making Firefox hang, the question is how to stop it. This function gets called from many places, and because it gets called by Watir in a firebug-less Firefox instance it is pretty tricky to debug. How can I stop this from h开发者_JAVA技巧appening?

Editing the file, extending the timeout and reducing the amount of HTML it has to deal with are not options.


Start Watir-WebDriver with Firebug enabled.

First download the Firebug XPI file, then:

profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension "../path/to/firebug.xpi"
b = Watir::Browser.new :firefox, :profile => profile

see: http://watirwebdriver.com/firefox/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜