Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Element is not clickable at point (617, 690.5). Other element would receive the click: <th>...</th> (Selenium::WebDriver::Error::UnknownError)

I get the error above when trying to press the "add" button on the integration test I am trying to implement. I thought that was a delay with the javascript, and I tried the following, but none of them worked:

Then /^I should click "([^"]*)"$/ do |selector|
  # if page.should have_selector(selector)
  # find(selector).click
  # end
  # page.execute_script("$(#{selector}).click()")
  find(selector).click
end

I tried all of the above, but that didn't solve the problem.

like image 554
vasgen Avatar asked Sep 13 '12 15:09

vasgen


People also ask

How do you resolve an element that 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.

How do you check whether the element is clickable or not?

We can check if the element is clickable or not in Selenium webdriver using synchronization. In synchronization, there is an explicit wait where the driver waits till an expected condition for an element is met. To verify, if the element can be clicked, we shall use the elementToBeClickable condition.

How do you handle an element not found in Selenium?

NoSuchElementException Ideally, the exception occurs due to the use of incorrect element locators in the findElement(By, by) method. To handle this exception, use the wait command. Use Try/Catch to ensure that the program flow is interrupted if the wait command doesn't help.


1 Answers

This is hardly a great answer, but I'll give it anyway...

I've only ever seen this problem when testing with Chrome. There are two solutions that worked for me:

  • Use Firefox instead of Chrome
  • Instead of find(selector).click, use page.execute_script("$(#{selector}).click()")

But since you've tried the second option and it didn't work, try using Firefox instead. Sorry :(

like image 84
Nat Ritmeyer Avatar answered Sep 27 '22 17:09

Nat Ritmeyer