问题
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