userimage

Wait for page load in Selenium

I am using Selenium 2.0 and want to wait for the page load to complete before perform any operation.
userimage

Hope below code will help you,


IWait<IWebDriver> wait = new OpenQA.Selenium.Support.UI.WebDriverWait(driver, TimeSpan.FromSeconds(30.00));
 wait.Until(driver1 => ((IJavaScriptExecutor)driver).ExecuteScript("return document.readyState").Equals("complete"));

Answer is