WebDriver - element is not clickable Chrome

Sowiarz picture Sowiarz · Sep 19, 2014 · Viewed 16k times · Source

I have following problem. I run test on Firefox and Chrome. On Firefox test run correctly but on Chrome SauceLabs give a message:

unknown error: Element is not clickable at point (717, 657). Other
element would receive the click: <div class="col-md-9 col-sm-12"
style="margin-top:8px;">...</div> (Session info: chrome=36.0.1985.125)
(Driver info: chromedriver=2.10.267521,platform=Windows NT 6.3 x86_64)

I choose element by unique css selector in both test in the same way:

driver.FindElement(By.CssSelector("button.btn-xs:nth-child(1)")).Click();

Any ideas what is wrong here?

Answer

bit picture bit · Sep 19, 2014

I am assuming that you have the correct element you need, ie the XPath is correct. Here are few ways out:

  1. Try to Click on the parent element instead.
  2. Try .Submit() instead of .Click()
  3. Try to execute the JavaScript that will be executed on the OnClick event of the element you are trying to click.

I have used the 3rd way with success all the time.

Another one

  1. Do a .SendKeys(Keys.Enter) on that element (or a Space key)