0

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
  • 1
    There's no reason to believe that if you set it properly that it wouldn't be set and stay the same unless you set it otherwise.
    – JeffC
    Commented Dec 28, 2018 at 18:02

1 Answer 1

2

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
    

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.