Selenium Web Driver & Java. Element Is Not Clickable At Point (X, Y). Other Element Would Receive the Click

Element is not clickable at point (80, 82). Other element would receive the click

try the below code :

new Actions(driver).moveToElement(webDriverWait.until(ExpectedConditions.elementToBeClickable(By.id(tabId)))).click().build().perform();

with both (with UI and Headless)

Selenium and Python. Element not clickable at point (x,y) because another element obscures it

It is quite common in HTML for some elements to be visually placed over others in the UI rendering. When Selenium WebElement.click() is used, the visual dimension of the element on which click has to be performed is obtained and click is performed. If there is an element occupying the same visual space, error is thrown.

There are 2 possible solutions.

  1. You can wait until the element is clickable using the below explicit wait

    element = WebDriverWait(self.driver, 20).until(EC.presence_of_element_located((By.ID, 'lg_1166')))
    element.click();
  2. Use javascript executor to click on the element. This would trigger a javascript click on the element by-passing the visual click.

    element = driver.find_element_by_id('lg_1166')
    driver.execute_script("arguments[0].click();", element)

Element is not clickable at point - other element would receive the click

As per your response :

You will have to scroll down to let the web element available to your script.For that you can use this code :

public static void scrollDown(WebDriver driver, String YoffSet){
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript(YoffSet);
}

here you can call this method anywhere from your code.

Then you can use this code to interact with the web element :

WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id("static ID")));  
element.click();

Element is not clickable at point (X, Y) in Selenium

Figured out the answer my self.

Added Thread.sleep(5000); before OK button.

Now my code works as expected. :)



Related Topics



Leave a reply



Submit