I am using Selenium ChromeDriver with an implicit timeout:
_driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
In one of my tests I want to override this with an explicit timeout. Before reading a property I explicitely wait for the element to be found:
WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(120));
wait.Until(d => d.FindElement(By.CssSelector("div.example")));
I would expect this to take 120s to try to find the element, but it times out after just 5 seconds.
As per the documentation of Explicit and Implicit Waits it is clearly mentioned that:
Still if you have implicit timeout defined as:
Before inducing explicit wait for the element to be found you need to remove the implicit timeout as follows:
Once you are done with the explicit wait, you can re-configure back the implicit timeout again as: