How do I validate that a particular checkbox is not selected/checked
This example demonstrates validating the checkbox is unselected/unchecked.
In the solution shown below, you will unselect/uncheck the checkbox option "Is coverage available from your or your spouse’s job?" in the HICC application using the "uncheck" command and then validate the selection using "verifyNotChecked" command.
Solution:
# | Command | Target | Value |
---|---|---|---|
Uncheck the checkbox "Is coverage available from your or your spouse’s job?" |
|||
1 | uncheck | //input[@name="chk_employerInsurance"] | |
Validating the checkbox is unchecked/unselected | |||
2 | verifyNotChecked |
//input[@name="chk_employerInsurance"] |
Tips, Tricks, Gotchas & Best Practices:
- To understand more about selecting a checkbox, click here.
- As an alternative, you are encouraged to use waitForNotChecked or assertNotChecked commands.
- You can also use storeChecked command to read if the checkbox is checked or not. To understand more about this, click here.