【发布时间】:2017-10-15 10:58:32
【问题描述】:
我正在使用 selenium 和 chrome 驱动器,但无法单击按钮, 我尝试了不同的方法,但没有:
link = driver.findElement(By.xpath("//button[@class='btn buttonContainer arrow']"));
link = driver.findElement(By.xpath("//input[@class='btn buttonContainer arrow']"));
link = driver.findElement(By.cssSelector("input[type='button']"));
link = driver.findElement(By.cssSelector("input[type='button'][value='btn buttonContainer arrow']"));
错误消息:
INFO: Detected dialect: OSS
Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: element not visible
(Session info: chrome=58.0.3029.96)
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10240 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15 milliseconds
代码:
<a class="ng-scope" ng-if="!loginCtrl.pageObject.isDebugMode" ng-click="rootCtrl.redirectToRegistration()">
<button class="btn buttonContainer arrow">
<span>Enter</span>
</button>
</a>
感谢阿米尔
【问题讨论】:
-
将网址粘贴到此按钮,以便您尝试
-
你想点击哪个按钮?
-
输入按钮
-
检查我的答案并更新我。谢谢
-
没什么意思?得到任何错误?或点击无效
标签: java html selenium-webdriver