首页 文章

点错误时无法点击元素

提问于
浏览
1

在点击一个元素的同时在Chrome浏览器上运行我的Selenium测试后,出现以下错误:

org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (30, 22). Other element would receive the click: <div tabindex="-1" role="dialog" class="modal fade ng-isolate-scope dialogs-default in" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10, display: 'block'}" ng-click="close($event)" modal-window="" window-class="dialogs-default" size="md" index="0" animate="animate" style="z-index: 1050; display: block;">...</div>
(Session info: chrome=41.0.2272.101)

我使用的是Chrome浏览器版本 41.0.2272.101 和Chrome驱动程序版本 ChromeDriver 2.15.322448

我通过互联网搜索并尝试以下 -

1

wait.until(ExpectedConditions.elementToBeClickable(designerViewButton));

2

((JavascriptExecutor)driver).executeScript("arguments[0].scrollIntoView(true);", driver.findElement(designerViewButton));

但它们都没有奏效 . 我是否需要使用chromedriver版本,这个版本比我使用它的版本要小?如果是这种情况,我在哪里可以获得以前的chromedriver版本?

1 回答

  • 0

    有两种变体 .

    1)确实存在另一个模态视图,其中z-index比你的按钮更高,你点击了错误的视图

    2)您试图无头或/和在没有设置分辨率的虚拟机上运行它

相关问题