Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebDriver - element is not clickable Chrome

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?

like image 234
Sowiarz Avatar asked Sep 19 '14 08:09

Sowiarz


People also ask

How do I fix element is not clickable at point?

The exception “Element is not clickable at point” might be thrown when the element is not under focus or the action is being performed on the incorrect WebElement. In such cases, you have to switch to the actual element and perform the click action.

Is not clickable at point other element would receive the click?

What Is the “Element Is Not Clickable at Point” Error? The error “element is not clickable at point” is self-explanatory. It means that the element that you're trying to click on can't be clicked at that particular point. You'd usually find this error when you locate an element and try to execute a click action on it.

Why click is not working in Selenium?

We can list the most common reasons for click problems as being one of the following: Wrong web element locations. The existence of a web element that obscures the web element that we want to click. The Selenium WebDriver works much faster than the response of the application.


1 Answers

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)
like image 151
bit Avatar answered Nov 03 '22 11:11

bit