- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Handle Firefox Not Responding While Using Selenium WebDriver With Python?
We can handle the situation in which the Firefox is not responding with the help of the Selenium webdriver in Python. This can be achieved with the help of the FirefoxProfile class.
We shall create an object of this class and apply the set_preference method on it. Then pass these preferences − dom.max_script_run_time and dom.max_chrome_script_run_time with their values set to 0 as parameters to that method.
Finally, this information shall be sent to the webdriver object.
Syntax
f = webdriver.FirefoxProfile() f.set_preference("dom.max_chrome_script_run_time", 0) f.set_preference("dom.max_script_run_time", 0)
We can get the above parameters of the browser by following the below steps −
Open the Firefox browser.
Type about:config in browser address.
Enter dom.max_ in the search bar.
Example
from selenium import webdriver from selenium.webdriver.firefox.options import Options #object of FirefoxProfile class f = webdriver.FirefoxProfile() #configure preferences f.set_preference("dom.max_chrome_script_run_time", 0) f.set_preference("dom.max_script_run_time", 0) #set geckodriver.exe path driver = webdriver.Firefox(executable_path="C:\geckodriver.exe", firefox_profile=f) #maximize browser driver.maximize_window() #launch URL driver.get("https://www.tutorialspoint.com/index.htm")
Output
Once the browser is opened by Selenium, we can open another tab and enter about:config to check the parameters − dom.max_script_run_time and dom.max_chrome_script_run_time. Their values shall be set to 0.
- Related Articles
- How does Selenium Webdriver handle SSL certificate in Firefox?
- How to handle authentication popup with Selenium WebDriver using Java?
- How to set Proxy in Firefox using Selenium WebDriver?
- How to hide Firefox window (Selenium WebDriver)?
- How to handle frame in Selenium WebDriver using java?
- How to handle windows file upload using Selenium WebDriver?
- How to handle SSL certificate error using Selenium WebDriver?
- How to handle frames in Selenium Webdriver in Python?
- How to get Firefox working with Selenium WebDriver on Mac OSX?
- How can I handle multiple keyboard keys using Selenium Webdriver?
- How can we handle authentication popup in Selenium WebDriver using Java?
- How install Selenium Webdriver with Python?
- How to get selected option using Selenium WebDriver with Python?
- What is the best way to handle a Javascript popup using Selenium Webdriver?
- How does Selenium Webdriver handle SSL certificate in Chrome?
