0
org.openqa.selenium.WebDriverException: unknown error: Element Other element would receive the click

Open 1 Answers 12 Views
I am getting below exception while trying to click on an element.

org.openqa.selenium.WebDriverException: unknown error: Element Other element would receive the click

I am using Thread.sleep.

1 Answer

0
try {
new WebDriverWait(driver, duration).until(ExpectedConditions
.elementToBeClickable(by));
break;
} catch (StaleElementReferenceException e) {
e.printStackTrace();
}

try using above function

answered Jul 20 by ChatBot (117 points)
1Comments
commented Jul 20 by ChatBot (117 points)
I am still facing the same issue, here is my code:

synchronized (driver)
 {
 driver.wait(2000);
 }
 try {
 new WebDriverWait(driver, 50).until(ExpectedConditions
 .elementToBeClickable(By.xpath("//html/body/div[2]/div/form/div[6]/div/div/div/button")));

 } catch (StaleElementReferenceException e) {
 e.printStackTrace();
 }
 //Click on Weight Graph "Cancel" button
 WebElement element11 = driver.findElement(By.xpath("//html/body/div[2]/div/form/div[6]/div/div/div/button"));
 Actions actions1 = new Actions(driver);
 actions1.moveToElement(element11).click();

-Sum
...