Skip to content

How do I unselect/uncheck a checkbox

This example demonstrates how to unselect/uncheck a checkbox.

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.

Solution:

# Command Target Value
Uncheck the checkbox "Is coverage available from your or your spouse’s job?"
1 uncheck //input[@name="chk_employerInsurance"]  

Tips, Tricks, Gotchas & Best Practices:  

  • To validate if a checkbox is unchecked or not, click here.
  • In some cases, you will see that some checkboxes are non-editable then you will need to check the editability of the checkbox. You can use the assertEditable command or verifyEditable command before performing any action (click/check) on the checkbox to confirm it is enabled for edit.
  • If the options of checkbox does not have an unique "id" in any application, you can provide a temporary "id" of your choice using the command assignId. Then you can use that "id" for identifying the element.
  • If the check command fails, you can perform the action with the below-mentioned alternatives.
  • You can use either the click or mouseDown command to select the checkbox.
  • If the above-mentioned commands fail to perform the action then you can use the runScript command to select the checkbox.

Feedback and Knowledge Base