setScriptTimeout() sets the amount of time to wait for an asynchronous script to finish execution before throwing an error.
setScriptTimeout()
setScriptTimeout()
sets the amount of time to wait for an asynchronous script to finish execution before throwing an error. If the timeout is negative, then the script will be allowed to run indefinitely.
Implementation
Java:
driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS);
Python:
driver.set_script_timeout(30)