How to set Page Load Timeout using C# and Selenium Webdriver

0 votes

I am using Selenium 2.20 WebDriver to create and manage a firefox browser with C#. To open the website or page, I am using the following code, setting the driver timeouts before visiting the URL:

driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); // Set implicit wait timeouts to 5 secs

driver.Manage().Timeouts().SetScriptTimeout(new TimeSpan(0, 0, 0, 5));  // Set script timeouts to 5 secs

driver.Navigate().GoToUrl(myUrl);   // Goto page url

 But pages takes lot of time to load and but default timeout for a page to load using the selenium WebDriver is 30 seconds, which is too long.How to fix this issue?
Aug 3, 2018 in Selenium by Martin
• 4,210 points
822 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Check this out

C# WebDriver API now contains the appropriate method.

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

answered Aug 3, 2018 by Samarpit
• 5,130 points

Related Questions In Selenium

0 votes
1 answer

How to know the exact time to load a page using Selenium WebDriver?

Normally WebDriver should return control to your ...READ MORE

answered Aug 23, 2018 in Selenium by Meci Matt
• 9,400 points
258 views
0 votes
1 answer

How to get a page name using Selenium Webdriver (C#)?

I believe the below thing works: driver.Title; READ MORE

answered Sep 14, 2018 in Selenium by Martin
• 4,210 points
63 views
0 votes
1 answer

How to scroll the Page up or down in Selenium WebDriver? (using java)

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,030 points
4,329 views
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,030 points
57 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
421 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
44 views
0 votes
2 answers

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

driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(15); READ MORE

answered Apr 16 in Selenium by Tim Muir
969 views
0 votes
1 answer

How to control Chrome Downloads page Using Selenium c#?

In your case you must replace 'cancel' ...READ MORE

answered May 7, 2018 in Selenium by Samarpit
• 5,130 points
631 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.