-1
<input class="chkbx-selection ng-pristine ng-untouched ng-valid" type="checkbox" value="test" id="isAgreeChkBox" ng-model="$root.isAgreement">

Please help me find what is the xpath/css selector here? I need to locate this using locators in selenide

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

0

The desired element is an Angular element so you need to induce WebDriverWait for the desired element to be clickable and you can use either of the following Locator Strategies:

  • cssSelector:

    new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("input.chkbx-selection.ng-pristine.ng-untouched.ng-valid#isAgreeChkBox[value='test']"))).click();
    
  • xpath:

    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();
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352