Selenium WebDriver - How to set Page Load Timeout using C# Selenium WebDriver - How to set Page Load Timeout using C# selenium selenium

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


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

Note: driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(5)) is now deprecated.


In case this helps anyone still looking for the answer to this, the C# WebDriver API now contains the appropriate method.

driver.Manage().Timeouts().SetPageLoadTimeout(timespan)


With this you should be able to declare a wait explicitly.

WebDriverWait wait = new WebDriverWait(browser, new TimeSpan(time in seconds));wait.until(Your condition)

you could also change the implicit wait time

driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));

I think that is the syntax in C#. (not to sure)

In ruby it is

@driver.manage.timeouts.implicit_wait = 30@wait = Selenium::WebDriver::Wait.new(:timeout => 30)