1

I need to get page load timeout for current driver object to be able to make something like this:

old_timeout = <get somehow current page load timeout value from self.driver>
new_timeout = 100
self.driver.set_page_load_timeout(new_timeout)
self.driver.get('https://stackoverflow.com')
self.driver.set_page_load_timeout(old_timeout)

In other words, I just want to get current timeout setting, change it to new one, do something and after that restore setting how it was. The only thing in this chain I don't know how to do - is to get current timeout setting.

I don't want to measure how long will it take to load page.

The idea is to change this setting for 1-time request and return it back how it was.

Thanks in advance.

2
  • 1
    Here you have similar questions stackoverflow.com/questions/16202548/… Commented Dec 7, 2016 at 12:01
  • Unfortunately, not similar. I don't want to know how long will it take to load the page (and measure it.). I just want to get current timeout setting, change it to new one, do something and after that restore setting how it was. The only thing in this chain I don't know how to do - is to get current timeout setting. Commented Dec 7, 2016 at 12:32

1 Answer 1

3

There isn't a way to get the current timeout settings from the driver. You have two options:

  • If you initialize the driver in the same class keep the timeout in variable.
  • Create temporary driver and work with it

    temp_driver = self.driver
    temp_driver.set_page_load_timeout(100)
    temp_driver.get('https://stackoverflow.com')
    
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.