Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you set Script Timeouts on Selenium Webdriver in Python?

There are three kinds of timeout functions for Java in Wedriver.Timeouts:

  1. implcitlyWait
  2. pageLoadTimeout
  3. setScriptTimeout

I'm trying to look up the python equivalent of the third, but am not able to find it. The following are the python equivalents of the first two.

  1. implicitly_wait(10)
  2. set_page_load_timeout(20)
like image 923
amitdatta Avatar asked Mar 19 '23 19:03

amitdatta


1 Answers

Is this what you are looking for :

set_script_timeout(time_to_wait)

    Set the amount of time that the script should wait during an
        execute_async_script call before throwing an error.

    Args :  

        time_to_wait: The amount of time to wait (in seconds)

    Usage : 

    driver.set_script_timeout(30)

Ref - set_script_timeout

like image 110
Amey Avatar answered Apr 06 '23 11:04

Amey