FCIM-Ashley FCIM-Ashley -3 years ago 282
C# Question

WebDriverWait in Chrome, Selenium C#

I have recently changed my WebDriver from Firefox to ChromeDriver and the wait steps I previously used to wait until an element could be interacted with no longer works"

WebDriverWait w = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
w.IgnoreExceptionTypes(typeof(StaleElementReferenceException), typeof(InvalidElementStateException));

I now often get errors like "Element is not clickable at point (964, 776). Other element would receive the click: " for example, even though the element is visible on the page.

Is there a way of telling the webdriver to wait until an element can be interacted with, or better, any settings that I could change to let Selenium know that I'm using Chrome so that my existing code works?

Answer Source

Latest version of Selenium C# Binding(2.46) provides a method to Expected Conditions named ElementToBeClickable. Try that instead. This is a very common issue with Chrome though.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download