0

As mentioned in the title, the following issue occurs since chrome was updated to v78. Before chrome v78 all tests worked just fine.

The behavior is highly nondeterministic, so please bear with me. Meaning sometimes it just works out of a sudden, without any changes. Most of the clicks in the tests are working. Just some fail repeatedly (most of the time).

We are using selenium with the latest driver for chrome 78. The problem appeared first on driver version 77 with chrome 78 running. Not the spec-flow tests nor the adapter-code has changed in any way, but after the Chrome update basically all tests failed.

Doing a Thread.Wait(1000) before EVERY CLICK seems to be the most reliable way to avoid the problem, and clicks the element as requested.

When im not waiting, the driver runs through the "Click", including the steps listed below, without actually clicking or throwing any error.

  • lookup of the element:
    new WebDriverWait(this.webDriver, this.WaitTimeout).Until<IWebElement>(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(by))
  • waiting for the element to be clickable:
    wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(by));
  • scrolling towards the element:
    ((IJavaScriptExecutor) this.webDriver).ExecuteScript("window.scrollTo(0, " + (object) (e.Location.Y - 250) + ")");
  • and performing a click and release action on the element:
    action.Click(element).Perform()

i have also tried several other variants of mouse clicks including the one from the comment.

Since the process just works through all this, without actually throwing an error or warning of any kind, i have no way of checking if the click actually happened (other than checking the current URL, which would be a nightmare to maintain in the tests).

So the website is not updating and remains on the source page and the test will fail because the next test doesn't run on the expected page.

now the question:

Is there anything i can query for or wait for to see whether the driver or chrome can actually click that element (really) or to verify that it was actually clicked?

original issue report: https://github.com/jsakamoto/nupkg-selenium-webdriver-chromedriver/issues/66

Chris
  • 527
  • 3
  • 15
  • Did you try regular click? `IWebElement element = wait.Until(...); element.Click()`? by the way, there is no need to call `Release()` after `Click()`. – Guy Nov 19 '19 at 10:00
  • We tried all kinds of clicks in the process. This is also the way we found the ActionChain methods. We didn't use them before. Will remove the release call. Thx for that. – Chris Nov 20 '19 at 07:39

0 Answers0