How to set Page Load Timeout using C# using Selenium WebDriver?

SeleniumAutomation TestingTesting Tools

We can set page load timeout using Selenium webdriver in C# using the PageLoad method. It is used to set time to wait for loading of the page. An exception will be thrown if the page is not loaded within the timeout specified.


driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(10);

Here, 10 is the amount of time in seconds.


using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System;
using OpenQA.Selenium;
namespace NUnitTestProject2{
   public class Tests{
      String url = "";
      IWebDriver driver;
      public void Setup(){
         //creating object of FirefoxDriver
         driver = new FirefoxDriver("");
      public void Test2(){
         //set page load time for 15 secs
         driver.Manage().Timeouts().PageLoad = TimeSpan.
         //URL launch
         Console.WriteLine("Page loaded successfully");
      public void close_Browser(){


Published on 07-Apr-2021 12:09:18