【问题标题】:Selenium ElementClickInterceptedException - Intercepted/Receive same elementSelenium ElementClickInterceptedException - 拦截/接收相同的元素
【发布时间】:2019-06-11 12:43:23
【问题描述】:

我尝试单击一个按钮,但出现此错误:

ElementClickInterceptedException: 

    element click intercepted: Element 
      <button class="ogOEj4x-0BpDZWeccJwxx s1vteny2-12 fJWqQW">...</button> 
        is not clickable at point (1108, 559).

    Other element would receive the click: 
      <button class="ogOEj4x-0BpDZWeccJwxx s1vteny2-12 fJWqQW">...</button>

在 HTML 中只有一个带有 class 的按钮。

那么这个错误的意义何在?无法点击按钮,因为它会收到点击?

【问题讨论】:

    标签: selenium


    【解决方案1】:

    也许尝试使用点击操作

    WebElement element = driver.findElement(By.id("id"));
    Actions actions = new Actions(driver);
    actions.moveToElement(element).click().build().perform();
    

    【讨论】:

    • 它有效。谢谢。 P.S.:现在也可以使用我的代码。我还是一头雾水。
    猜你喜欢
    • 2021-10-08
    • 2021-05-16
    • 2019-11-08
    • 2019-12-29
    • 2019-12-13
    • 2020-09-09
    • 2021-08-26
    • 2021-09-04
    • 1970-01-01
    相关资源
    最近更新 更多