Page load timeout is one of the timeouts mechanism in Selenium and it focuses on the time a webpage is loaded.
The page load timeout limits the time that the script allows for a web page to be loaded.
If the page is loaded within the time, then the script continues further execution.
If the page is not loaded within the timeout, then the script will be stopped by a TimeoutException.
This timeout setting will remain in force for the remainder of the script (until changed) and will affect any calls that generate a new web page. This includes the get() method. However, the timeout may be delayed until the first findElement() call for the new page, since the navigation method may return asynchronously.
As a result, when using the timeout, webpage navigation should be executed under the control of try-catch clauses that catch the TimeoutException. For example:
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
No comments:
Post a Comment