Why doesn't the desired assertion appear when recording?
  • 07 Sep 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Why doesn't the desired assertion appear when recording?

  • Dark
    Light

Article Summary

If you cannot record an assertion after clicking an element, or if the desired type of assertion does not appear as an option, the following may be the cause.

You have selected a different element close to the one you intended.

First, please ensure you have selected the correct element on which you want to use the assertion.
The type of assertion available depends on which element you select.
For example, suppose you want to use an assertion that checks whether a button is enabled (clickable) or disabled (non-clickable).
In this case, you need to select a <button> element.
If you select a element that's close to the intended one (such as a parent or sibling element), you may not see the "Element Should Be Enabled / Disabled" assertion.

The CSS property pointer-events: none is applied to the target element.

If you cannot record an assertion on the desired element, the element may have the CSS property pointer-events: none applied to it. If this CSS property is applied, event firing will be disabled, and the Autify Recorder cannot record actions on the element.
In this case, there are two workarounds:

1. Remove pointer-events: none

You can remove the style by changing your website, or temporarily disable the property via Chrome DevTools.
We recommend this workaround as it will allow Autify Recorder to recognize the element, but if it doesn't work, please try the next solution.

2. Use the assertion step you created when pointer-events: none was not applied

As an example, here is a workaround for validating whether a button is enabled or disabled.
The following condictions must be met to use this workaround:

  • When the button is enabled, you can focus on the target element and create an Element Should Be Enabled step.
  • When the button is disabled, you cannot focus on it due to the pointer-events: none property and the "Element Should Be Disabled" assertion does not appear.

If these conditions are met, you can verify that the button is invalid in the following way:

  1. Copy the "Element Should Be Enabled" step from the scenario (if the step does not exist yet, please create one by recording it).
  2. Open the "Element Should Be Enabled" step that you copied, select "Element Should Be Disabled" in the Action section, and save it.
    change-action-en.png

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.