How to retrieve the page load timeout through Selenium and Python

1k Views Asked by At

Is there any method in Python + Selenium for retrieving the webdriver's current page load timeout?

I know to use set_page_load_timeout() and examining the Chromedriver logs shows that this modified its internal state so I am wondering if there's way to query for it?

Alternatively, I will simply save the value on my side of the code. The retrieval would be helpful to verify that the timeout was successfully set and later on that it's still the same.

1

There are 1 best solutions below

0
undetected Selenium On

When you initialize the WebDriver it is configured with a default page_load_timeout of 300000 seconds which you can extract from the capabilities dictionary as follows:

  • Code Block:

    from selenium import webdriver
    
    driver = webdriver.Firefox(executable_path=r'C:\Utility\BrowserDrivers\geckodriver.exe')
    dict = driver.capabilities['timeouts']
    print(dict["pageLoad"])
    driver.quit()
    
  • Console Output:

    300000