无法单击应用程序中的任何按钮。
错误堆栈跟踪:
org.openqa.selenium.ElementNotVisibleException: element not interactable
(Session info: chrome=73.0.3683.103)
(Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.10.0', revision: '176b4a9', time: '2018-03-02T19:03:16.397Z'
System info: host: 'SHIPAWAR-54Q9D', ip: '10.65.75.122', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.chrome.ChromeDriver
我尝试了Java脚本执行器,动作类,但没有一个起作用
public void clickHERE(String deal) throws Throwable{
javaScriptClick(driver, HERE);
driver.findElement(By.xpath(enterDeal)).sendKeys(deal);
Thread.sleep(5000);
int ok_size=driver.findElements(By.cssSelector("[name=SearchDeal]")).size();
System.out.println("the search button size:" +ok_size);
driver.findElement(By.xpath(enterDeal)).sendKeys(Keys.ENTER);
Thread.sleep(5000);
scrollToElement(driver, nextTabDealInfo);
driver.findElement(By.xpath(nextTabDealInfo)).click(); // this button in not working
}
应该可以单击按钮。
nextTabDealInfo
是xpath:
//*[@type='button' and contains(@value,'Next Tab')]
按钮的HTML:
<input type="button" name="fromOptyInfoTab" value="Next Tab >" onclick="return switchTabs('nonStandardInfo.do');" class="buttonNextTab">
答案 0 :(得分:0)
此错误消息...
org.openqa.selenium.ElementNotVisibleException: element not interactable
.
System info: host: 'SHIPAWAR-54Q9D', ip: '10.65.75.122', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_60'
...表示 ChromeDriver 无法与 Chrome浏览器会话进行通信。
您的主要问题是所使用的二进制版本之间的不兼容性:
因此 JDK v8u60 和 Selenium Client v3.10.0
之间存在明显的不匹配