2016-08-22 69 views
1

当试图点击ExtnJs申请一个按钮,我收到以下错误的错误:ExtnJS-“元素不是在点点击”错误

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

在点击一个按钮,页面将被装入一个新内容。

代码:

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

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

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

Click操作不会发生,但对象是越来越确定。然后显示错误消息失败。

请让我如何解决这个问题。 感谢

回答

1

如果不幸.click()不会因为其他因素的叠加工作,你应该尝试如下使用JavascriptExecutor: -

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

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

感谢: ) 有效 –

1

试试这个,

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

由于它的工作 –

相关问题