How to verify the checkbox on a section, maximum 10, 2 in a row, and the checkbox is checked?
To verify checkbox is checked
Boolean isCheckboxChecked =
driver.findElement(By.xpath("//*[contains(@class, 'checkboxSection')]//input[@type='checkbox']")).isSelected();
To verify max checkbox on that section is 10
Boolean isCheckboxMaxTen =
driver.findElements(By.xpath("//*[contains(@class, 'checkboxSection')]//input[@type='checkbox']")).size() <= 10;
To verify max 2 checkbox in a row
Any idea how to verify max 2 checkbox in a row
if ((isCheckboxChecked == true) && (isCheckboxMaxTen == true) && (isCheckboxTwoInARow == true)){
// Pass
}
else
{
// Fail
}
Aucun commentaire:
Enregistrer un commentaire