How does one select the check box in Selenium Java if we have two preceding checkboxes in Java?
My code is below:
String xpath = "//h2[text()='Safeguard workplace']/following-sibling::div/descendant::label[text()='" + SafeguardWorkplace + "']/ancestor::div/preceding-sibling::input[@type='checkbox']";
WebElement element = findElement(By.xpath(xpath));
element.click();
Aucun commentaire:
Enregistrer un commentaire