This question already has answers here:
Element MyElement is not clickable at point (x, y)… Other element would receive the click

(5个答案)


4天前关闭。





我查找了类似的问题,但根本找不到解决方案。我什至尝试过Thread.sleep,但也没有用。
我仍然得到

enter image description here

“ org.openqa.selenium.ElementClickInterceptedException:元素点击被拦截:元素...在点(1322,246)不可点击。其他元素将获得点击:
(会话信息:chrome = 83.0.4103.97)”错误。

这是我的代码;

    //click on relative info
    WebDriverWait wait = new WebDriverWait(driver,20);

   driver.findElement(By.cssSelector("div.mat-tab-labels>div:nth-child(3)")).click();

    //click on representative
    driver.findElement(By.xpath("(//*[@aria-label=\"Representative\"]//following::span)[1]")).click();
    wait.until( ExpectedConditions.visibilityOfElementLocated( By.cssSelector(".cdk-overlay-pane") ) );

    //select representative
    driver.findElement(By.xpath("//*[@id=\"mat-option-73\"]")).click();

    wait.until( ExpectedConditions.invisibilityOfElementLocated( By.cssSelector(".cdk-overlay-pane") ) );


非常感谢您的帮助。谢谢

最佳答案

他可能有一个iframe

如果有iframe,则需要切换到iframe

driver.switchTo().frame("iframeId");//iframe id or iframe name


最好发布网络代码

关于java - 元素不可点击问题Selenium ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/62400262/

10-11 02:44
查看更多