我只在Chrome浏览器中看到这个。

完整的错误信息如下:

“org.openqa.selenium。WebDriverException:元素在点(411,675)不可点击。其他元素会收到点击:……”

“将接收点击”的元素位于相关元素的一侧,而不是在元素的顶部,也没有重叠,也没有在页面上移动。

我试过加一个偏移量,但也不行。该项目在显示的窗口上,不需要滚动。


当前回答

我在使用xvfb-run运行测试时遇到此错误。他们在当地工作得完美无缺。使用chrome, webdriver / chromedriver / chrome / java等版本都相同。

在chromedriver - GitHub Link中,“不会修复”的bug由Tony Lâmpada指出,这可能与屏幕上可见/不可见的内容有关。

xvfb-run的帮助信息如下所示:

-s ARGS   --server-args=ARGS    arguments (other than server number and
                                "-nolisten tcp") to pass to the Xvfb server
                                (default: "-screen 0 640x480x8")

更改xvfb的分辨率可以消除错误:

xvfb-run -s "-screen 0 1280x1024x16" ...

其他回答

我也遇到了同样的问题,这是由div和div内链接之间的id冲突引起的。所以驱动程序点击了div而不是我想要的链接。 我改变了div id,它正常工作。

之前:

<div id="logout"><a id="logout" href="logoutLink">logout</a></div>

后:

<div id="differentId"><a id="logout" href="logoutLink">logout</a></div>

也许这不是一个干净的解决方案,但它是有效的:

try:
    el.click()
except WebDriverException as e:
    if 'Element is not clickable at point' in e.msg:
        self.browser.execute_script(
            '$("{sel}").click()'.format(sel=el_selector)
        )
    else:
        raise

我在python中运行selenium脚本时遇到了同样的问题。下面是我用来点击元素的:

from selenium.webdriver.common.action_chains import ActionChains


ActionChains(driver).click(element).perform()

我遇到这个是因为这个元素上有一个加载对话框。我只是通过在使用this元素之前添加一个等待来解决这个问题。

try {
        Thread.sleep((int) (3000));
    } catch (InterruptedException e) {
        //
        e.printStackTrace();
    }

希望这对你有所帮助!

我也遇到了同样的问题,花了好几个小时才找到解决办法。我试着用量角器点击一个长ngGrid底部的单元格。这是我的ngrrid html的快照:

....many rows here..
<!- row in renderedRows ->
   <!- column in renderedColumns ->
   <div ...> <a ngclick="selectRow(row)"...>the test link 100000</a>...
....

所有的点击功能都不能工作。解决方案是在元素的当前范围内使用evaluate:

element(by.cssContainingText("a", "the test link 100000"))
    .evaluate("selectRow(row)")