Mobile Appium:元素不可交互点击复选框时显示错误 已尝试:xpath=/*[@id=“mktoCheckbox\u 52362\u 0”]

Mobile Appium:元素不可交互点击复选框时显示错误 已尝试:xpath=/*[@id=“mktoCheckbox\u 52362\u 0”],mobile,appium,emulation,Mobile,Appium,Emulation,控制台错误:元素不可交互 已尝试:Xpath=/[@id=“mktoform2768”]/div[10]/div[1]/div[2]/div[2]/label 控制台错误:元素不可交互 已尝试:xpath=/*[text()=“我同意”] 单击“许可协议”链接并在“其他”选项卡中打开pdf文件 应用了上述所有xpath,但仍然没有得到任何结果。请提供此问题的一些解决方案。假设您正在尝试自动化此页面: 如果要在新选项卡中打开许可协议,则相关XPath将是 //a[text()='License

控制台错误:元素不可交互

  • 已尝试:
    Xpath=/[@id=“mktoform2768”]/div[10]/div[1]/div[2]/div[2]/label
  • 控制台错误:元素不可交互

  • 已尝试:
    xpath=/*[text()=“我同意”]
  • 单击“许可协议”链接并在“其他”选项卡中打开pdf文件


    应用了上述所有
    xpath
    ,但仍然没有得到任何结果。请提供此问题的一些解决方案。

    假设您正在尝试自动化此页面:

    • 如果要在新选项卡中打开许可协议,则相关XPath将是

      //a[text()='License Agreement']
      

    • 如果要勾选与许可协议关联的复选框,则需要此复选框:

      //input[@name='termsandConditions']
      

    在这两种情况下,最好在尝试通过功能与元素交互之前使用,以确保元素是可单击的

    如果你正在研究移动自动化,你可以考虑使用它,它可以在定义元素定位器

    时使你的生活更容易。

    假设您正在尝试自动化此页面:

    • 如果要在新选项卡中打开许可协议,则相关XPath将是

      //a[text()='License Agreement']
      

    • 如果要勾选与许可协议关联的复选框,则需要此复选框:

      //input[@name='termsandConditions']
      

    在这两种情况下,最好在尝试通过功能与元素交互之前使用,以确保元素是可单击的

    如果你正在研究移动自动化,你可以考虑使用它,它可以在定义元素定位器

    时使你的生活更容易。

    这是HTML:我同意“target=“\u blank”title=“License Agreement”id=”“>许可协议这是HTML:我同意“target=“\u blank”title=“License Agreement”id=“”>尝试使用//输入[@name='termsandConditions']时的许可协议。获取错误为:org.openqa.selenium.ElementNotVisibleException:element不可交互,应用时-----------------------------------------------------------------------------WebDriverWait wait=new WebDriverWait(驱动程序,10);WebElement=wait.until(ExpectedConditions.elementToBeClickable(By.xpath(“//input[@name='termsandConditions']”));元素。单击()--------------------控制台错误:org.openqa.selenium.TimeoutException:预期条件失败:等待元素可单击:By.xpath://input[@name='termsandConditions'](在尝试//input[@name='termsandConditions']时以500毫秒的间隔尝试了10秒)。获取错误为:org.openqa.selenium.ElementNotVisibleException:element不可交互,应用时-----------------------------------------------------------------------------WebDriverWait wait=new WebDriverWait(驱动程序,10);WebElement=wait.until(ExpectedConditions.elementToBeClickable(By.xpath(“//input[@name='termsandConditions']”));元素。单击()--------------------控制台错误:org.openqa.selenium.TimeoutException:预期条件失败:等待元素可单击:By.xpath://input[@name='termsandConditions'](每隔500毫秒尝试10秒)