Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Element is not clickable at point (x,y.5) because another element obscures it

I am trying to click on an element but getting the error:

Element is not clickable at point (x,y.5)

because another element obscures it.

I have already tried moving to that element first and then clicking and also changing the co-ordinates by minimizing the window and then clicking, but both methods failed. The possible duplicate question has answers which I have already tried and none of them worked for me.

Also, the same code is working on a different PC.

How to resolve it?

like image 784
Shubham srivastava Avatar asked Mar 13 '18 09:03

Shubham srivastava


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.

Is not clickable other element would receive the click?

WebDriverException - Element is not clickable at point (xx, xx). Other element would receive the click'. This happens when the element is loaded into the DOM, but the position is not fixed on the UI. There can be some other divs or images or ads that are not loaded completely.

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.


1 Answers

This often works when element.click() does not:

element = driver.find_element_by_xpath(xpath)
driver.execute_script("arguments[0].click();", element)
like image 196
wrecks Avatar answered Sep 27 '22 21:09

wrecks