This question has been asked before, but the answer given does not seem to work for me. The problem is, when opening a page using Selenium, I get numerous "Unresponsive Script" pop ups, referencing varying scripts.
When I open the page using Firefox without Selenium, I get no errors. Also, oddly, when I open the page using selenium manually it works. So I can't even pinpoint the problem.
I can share the code, but doing so isn't necessary. Essentially what happens is this:
driver = webdriver.Firefox()
driver.get(url)
do other things (either open links or get page source)
driver.close()
As far as I can tell, the error is occurring on the second step (get url).
I have set the script wait condition in about:config to very high numbers, and 0, and I still get the error.
Is there a solution to this problem?
Note, I am not opening my own pages for testing purposes. Rather, i am opening a third party site, to obtain certain data. Note also, that sometimes volume can get pretty high (a lot of pages being opening by different programs at the same time) - maybe that's the problem??
My problem right now is mostly that I can't even replicate the problem on another computer, I am just completely lost. I hoping someone else out there has had a similar problem and found a solution. I have a feeling this has something to do with the settings in Firefox (not about:config).
After trying many settings, I think I have found one that works, and, alas, it was mentioned here, I just didn't really understand how to use it (b/c I had never dealt with firefox profile setting in selenium): Selenium & Firefox: How can i turn off "Unresponsive script" warnings?
The solution is as follows:
from selenium import webdriver
fp = webdriver.FirefoxProfile()
fp.set_preference("dom.max_chrome_script_run_time", 0)
fp.set_preference("dom.max_script_run_time", 0)
driver = webdriver.Firefox(firefox_profile=fp)
public class Send10000CharactersToChat {
private static WebDriver firefoxDriver;
@Before
public void initialize() {
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("dom.max_chrome_script_run_time", 0);
profile.setPreference("dom.max_script_run_time", 0);
firefoxDriver = new FirefoxDriver(profile);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With