Workaround when the "Element checked" assertion is unavailable during recording

Prev Next

This article explains the workaround for when you want to use the "Element checked" or "Element unchecked" assertion on a target element during recording, but they are disabled (grayed out) and cannot be selected in the menu.

This issue occurs when the target element is not a standard HTML checkbox element. For example, custom UI elements (such as <div> or <span>) that are implemented to look like checkboxes using CSS or JavaScript are not standard HTML checkbox elements, so they are not eligible for the "Element checked" assertion.

In such cases, you may be able to verify the checked state by using the "Looks the same" assertion as an alternative.

Steps

Create a step to compare the appearance of the target element in a checked state (or the state you want to verify).

  1. Start recording and set the target element to a checked state.

  2. Click the element assertion icon icon on the recorder toolbar.

  3. Click the target element.

  4. When the assertion menu appears, select Looks the same.

  5. When the screen to set the difference threshold (%) appears, enter the acceptable pixel difference percentage (the default is 0).

  6. Click Add to confirm the assertion.