如何使用Selenium和Java定位元素
请帮我找到这里的xpath/css选择器是什么?我需要使用selenide中的定位器来定位该元素,所需元素是一个元素,因此您需要引导WebDriverWait以使所需元素可单击,并且您可以使用以下任一选项:如何使用Selenium和Java定位元素,java,selenium-webdriver,xpath,css-selectors,selenide,Java,Selenium Webdriver,Xpath,Css Selectors,Selenide,请帮我找到这里的xpath/css选择器是什么?我需要使用selenide中的定位器来定位该元素,所需元素是一个元素,因此您需要引导WebDriverWait以使所需元素可单击,并且您可以使用以下任一选项: css选择器: <input class="chkbx-selection ng-pristine ng-untouched ng-valid" type="checkbox" value="test" id="isAgreeChkBox" ng-model="$root.isAgr
:css选择器
<input class="chkbx-selection ng-pristine ng-untouched ng-valid" type="checkbox" value="test" id="isAgreeChkBox" ng-model="$root.isAgreement">
:xpath
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("input.chkbx-selection.ng-pristine.ng-untouched.ng-valid#isAgreeChkBox[value='test']"))).click();
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@class='chkbx-selection ng-pristine ng-untouched ng-valid' and @id='isAgreeChkBox'][@value='test']"))).click();