The "Check/Uncheck" command can only be used on input elements with the type attribute "checkbox". If a different element is specified, the error message Cannot find a UI element for this command <error details>
will appear.
To fix this, follow one of the two following methods:
1. Search for an input element with the type attribute "checkbox"
First, search if there is an input element with the type attribute "checkbox".
In such cases, the <error details>
might display a message like Possible candidate is {key=***, value=***}
, providing information about a suitable UI element. Use this information as a reference.
Temporarily hide the currently specified UI element to see if there are any other suitable input elements.
An input element has the following characteristics:
- UI element name: "***" checkbox
- Locator:
- CSS: Starts with "input".
Example: css=input[name=***]
- XPath: Ends with "input".
Example: xpath=//***/input[1]
- CSS: Starts with "input".
To confirm the type attribute, it's recommended to check using the developer tools.
If a suitable UI element is found, specify it for the "Check/Uncheck" command.
2. Change to Click command
If no suitable UI element is found, you cannot use the "Check/Uncheck" command for that checkbox. Instead, use the Click command.