看起来像这样 id("ctl05_cbMulti_DropDown")/div[@class="rcbScroll rcbWidth"]/ul[@class="rcbList"]/li[@class="rcbHovered"]/label[1]/input[@ class="rcbCheckBox"]这些都不起作用司机。findElement(By.xpath("(//input[@type='checkbox'])[2]")).click(); 或 driver.findElement(By.id("ctl05_ctl03_cblUser_Input")).sendKeys("Smith, John");
3 回答

一只斗牛犬
TA贡献1784条经验 获得超2个赞
我在您的第一行代码中看到了一些错误。您不应该在 xpath 中传递“(”。
正确的代码应该是:
new WebDriverWait(driver, 30).until(ExpectedConditions.ElementToBeClickable (By.xpath("//input[@type='checkbox'][2]")));
driver. findElement(By.xpath("//input[@type='checkbox'][2]").click();
没有找到匹配的内容?试试慕课网站内搜索吧
添加回答
举报
0/150
提交
取消