【问题标题】:Selenium / Java : Unable to locate element on a ion search popupSelenium / Java:无法在离子搜索弹出窗口中找到元素
【发布时间】:2022-01-08 13:23:33
【问题描述】:

我们正在尝试自动化流程,它需要在下面的弹出窗口上单击 + 签名。 我们已经尝试过 xpath 定位器,但没有找到元素。 下面我们得到以下错误:

error : org.openqa.selenium.ElementClickInterceptedException: element click intercepted: Element <ion-icon color="gray-900" name="ios-add-circle-outline" role="img" class="icon icon-ios icon-ios-gray-900 ion-ios-add-circle-outline" aria-label="add circle-outline"></ion-icon> is not clickable at point (1135, 195). Other element would receive the click: <span class="button-inner">...</span>

元素定位码是

我们在步骤定义中使用以下代码:

元素定位器:

@FindBy (xpath = "//*[@name='ios-add-circle-outline']")
private WebElement plusIcon;

点击下面的代码正在被我们使用。 方法()

> String currentWindow = driver.getWindowHandle();
> driver.switchTo().window(currentWindow);
> Thread.sleep(3000);
> plusIcon.click();

【问题讨论】:

  • 以跨度或按钮为目标...按钮可能是事件处理程序所在的位置...

标签: java selenium selenium-webdriver cucumber-java


【解决方案1】:

用于克服上述问题的动作类。

> Actions builder = new Actions(driver);
> builder.moveToElement(plusIcon); 
> builder.click(); builder.perform();

【讨论】:

    猜你喜欢
    • 2018-06-04
    • 2022-01-04
    • 2017-01-30
    • 2013-01-16
    • 1970-01-01
    • 2019-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多