Element... is not clickable at point (x, y). Other element would receive the click" Element... is not clickable at point (x, y). Other element would receive the click" Element... is not clickable at point (x, y). Other element would receive the click" can be caused by various factors. You can eliminate them in one of the following ways:
- Element not clicked due to JavaScript or AJAX calls
Try using the Actions class:
WebElement element = driver.findElement(By.id("id1")); Actions actions = new Actions(driver); actions.moveToElement(element).click().build().perform();
- The item does not get clicked, as it is not included in the Viewport
Try using the JavascriptExecutor to cast an element to the Viewport:
JavascriptExecutor jse1 = (JavascriptExecutor)driver; jse1.executeScript("scroll(250, 0)"); // if the element is on top. jse1.executeScript("scroll(0, 250)"); // if the element is at bottom.
Or
WebElement myelement = driver.findElement(By.id("id1")); JavascriptExecutor jse2 = (JavascriptExecutor)driver; jse2.executeScript("arguments[0].scrollIntoView()", myelement);
- The page is refreshed before the item becomes clickable.
In this case, induce a little wait .
- An element is present in the DOM, but is not clickable.
In this case, add a few ExplicitWait so that the element is active.
WebDriverWait wait2 = new WebDriverWait(driver, 10); wait2.until(ExpectedConditions.elementToBeClickable(By.id("id1")));
- The item is present but has a temporary overlay.
In this case, call ExplicitWait with ExpectedConditions set to invisibilityOfElementLocated so that Overlay is invisible.
WebDriverWait wait3 = new WebDriverWait(driver, 10); wait3.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("ele_to_inv")));
- The element is present but has a constant overlay.
Use the JavascriptExecutor to send a click directly to an element.
WebElement ele = driver.findElement(By.xpath("element_xpath")); JavascriptExecutor executor = (JavascriptExecutor)driver; executor.executeScript("arguments[0].click();", ele);