有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java元素不可单击

我查过类似的问题,但根本找不到解决办法。我甚至试过线。睡觉,但也不起作用。 我仍然得到了那份工作

enter image description here

“org.openqa.selenium.element点击拦截异常:element点击拦截:element…在点(1322246)处不可点击。其他元素将收到点击: (会话信息: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") ) );

共 (1) 个答案

  1. # 1 楼答案

    他可能有一个iframe

    如果存在iframe,则需要切换到iframe

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

    最好发布网络代码