1
votes

When trying to click a button on ExtnJs appl I receive the error following error:

org.openqa.selenium.WebDriverException: Element is not clickable at point (x, y). Other element would receive the click: <div id=" ">..</div>

On clicking a button,page will be loaded with a new contents.

code:

driver.findElement(by.xpath("//a[@id='tabNameAtnBtn']")).click();

or

driver.findElement(by.xpath("//a/span/span/span[contains(text(),'Name')]")).click(); 

or

action.moveToElement(driver.findElement(by.xpath("//a[@id='tabNameAtnBtn']"))).click().perform();

Click operation is not happening, but the object is getting identified. and then fails with displaying the error message.

Please let me how to resolve this issue. Thanks

2

2 Answers

1
votes

If unfortunately .click() does not work due to overlay of other element, you should try using JavascriptExecutor as below :-

WebElement el = driver.findElement(By.id("tabNameAtnBtn"));

((JavascriptExecutor)driver).executeScript("arguments[0].click()", el);
1
votes

Try this,

WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("")));