【问题标题】:Not able to click on checkbox Since that content of the checkbox is having url无法单击复选框因为复选框的内容具有 url
【发布时间】:2022-01-31 09:39:05
【问题描述】:

我尝试了很多方法来单击复选框,但是当我尝试单击时它会打开 URL 我尝试使用 class 、 name 和 for object 但它打开了 url 和 ::before 和 ::after 突出显示特定的复选框 [::before][1]

【问题讨论】:

  • 您需要在此处分享您为答案/解决方案编写的代码。如有可能,请检查网站链接。

标签: java selenium selenium-webdriver selenium-chromedriver selenium-ide


【解决方案1】:

复选框是一个复选框,无论左侧或右侧显示什么内容。

driver.findElement(By.cssSelector("Your CSS selector here")).click();

driver.findElement(By.xpath("Your xpath expression here"))click();

请分享您的代码,否则您遇到的错误

【讨论】:

    猜你喜欢
    • 2017-10-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多