This article mainly introduces the timeout parameter of selenium’s webdriver.
This is equivalent to setting a global wait. When locating an element, a timeout period is set for all elements. If the timeout period is exceeded, an exception is thrown. The default is 0, which means no waiting.
An implicit wait is to tell WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediate ly available. The default setting is 0. Once set, the implicit wait is set for the life of the WebDriver object instance.
If implicitlyWait is not set, driver.findElement () will only find the specified element once and throw the exception immediately if it cannot be found.
Set the timeout period for asynchronous script execution, and throw exceptions if exceeded.
The amount of time, in milliseconds, this session should wait for asynchronous scripts to finish executing. If set to 0, then the timeout will not fire until the next event loop after the script is executed. This will give scripts that employ a 0-based setTimeout to finish.
It is used to set the timeout period for full page loading, i.e. full page rendering. Exceeding this time, an exception is thrown. The default is -1, which means it will never time out.
Sets the amount of time to wait for a page load to complete before throwing an error. If the timeout is negative, page loads can be indefinite.
Does this include asynchronous scripts that have all been executed? onload generally refers to external resources that have been loaded, while asynchronous scripts that have been executed should not be the same as this.