WebDriverWait采用铬、硒C#

WebDriverWait采用铬、硒C#,c#,selenium,automation,webdriver,selenium-chromedriver,C#,Selenium,Automation,Webdriver,Selenium Chromedriver,我最近将我的WebDriver从Firefox改为ChromeDriver,而我以前用来等待某个元素与之交互的等待步骤也不再有效。” WebDriverWait w=新的WebDriverWait(驱动程序,TimeSpan.FromSeconds(10)); w、 IgnoreExceptionTypes(typeof(StaleElementReferenceException)、typeof(InvalidElementStateException)); w、 直到(ExpectedCon

我最近将我的WebDriver从Firefox改为ChromeDriver,而我以前用来等待某个元素与之交互的等待步骤也不再有效。”

WebDriverWait w=新的WebDriverWait(驱动程序,TimeSpan.FromSeconds(10));
w、 IgnoreExceptionTypes(typeof(StaleElementReferenceException)、typeof(InvalidElementStateException));
w、 直到(ExpectedConditions.element存在(By.Id(“formSubmit”));

我现在经常会遇到类似“元素在点(964776)处不可单击”这样的错误。其他元素将收到单击:“例如,即使该元素在页面上可见

有没有一种方法可以告诉webdriver等待某个元素可以与之交互,或者更好,我可以更改任何设置,让Selenium知道我正在使用Chrome,以便我的现有代码正常工作?

最新版本的提供了一种方法来处理名为
ElementToBelickable
的预期条件。尝试一下。这是一个版本不过,Chrome有一个共同的问题。

还有很多方法 这是我的最爱

try{
   //for example
           site.FindElement(By.Id("ctl00_ContentPlaceHolderBody_drp_City")).Click();

   }catch{

  Thread.Sleep(Time in sec);
           site.FindElement(By.Id("ctl00_ContentPlaceHolderBody_drp_City")).Click();

   }

谢谢,我已经改到2.46了,看起来效果不错。非常感谢。