【发布时间】:2018-03-16 17:36:26
【问题描述】:
在 selenium 测试执行中我得到:
未知错误:元素 ... 在该点不可点击 (1147, 21)。其他元素会收到点击:...(会话信息:chrome=59.0.3071.115)
代码从这里开始:
List<WebElement> button = driver.findElements(By.xpath("//*[@class='btn btn-primary']"));
for (WebElement firstbutton : button) {
int count = 1;
System.out.println("count is " + count + " Hence it should click he button if button is displayed : ");
if (count == 1) {
// ((JavascriptExecutor)
// driver).executeScript("scroll(0,400)");
// act.moveToElement(firstbutton).click();
firstbutton.click();
System.out.println("Save button is clicked");
break;
} else {
System.out.println("Button is already clicked");
}
}
【问题讨论】: