Having issues with click when using new version of chromedriver, chrome and selenium in c#

筅森魡賤 提交于 2021-01-29 07:53:54

问题


I am using latest chrome 77.0.3865.90 I have tried chromedriver versions - 77.0.3865.4000, 76.0.3809.* The code is in C#

I am finding an element on the page and doing click on it. This used to work fine and I think after new chrome browser update (to 77.0.3865.90) i am getting this error for clicks :

unknown error: failed to parse value of getElementRegion\n (Session info: chrome=77.0.3865.90)"}

I tried using multiple chromedriver versions as above nothing seems to work.

            WebDriverWait wait = new WebDriverWait(Driver, new TimeSpan(0, 0, 30));
        wait.Until(ExpectedConditions.ElementToBeClickable(By.Id("imgSearchReceiver"))).Click();

回答1:


Load Selenium Extras to your solution.

var wait = new WebDriverWait(driver, new TimeSpan(0, 0, 30));
var element = wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.Id("imgSearchReceiver")));



回答2:


Use Thread.sleep(4000). Sometimes WebDriverWait doesn't work for some element you need hard wait, sleep is the best solution for it.



来源:https://stackoverflow.com/questions/58274561/having-issues-with-click-when-using-new-version-of-chromedriver-chrome-and-sele

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!