PageLoadTimeOut in Selenium

package webdriver;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class PageLoad {
	static WebDriver driver;

	public static void main(String[] args) {
		driver = new FirefoxDriver();
		driver.manage().timeouts().pageLoadTimeout(5, TimeUnit.SECONDS);


The above code will verify the page is getting load with expected time(5 Sec) or not.  If Page will not load completely within the given time then selenium will throw the TimeoutException in the console.

Leave a Reply

Your email address will not be published. Required fields are marked *