Hi Alex, it seems that the issue you encountered is due to the click step not finding the element with the CSS selector .hover. This situation likely occurred because the element’s state temporarily changed when it received focus, and the class hover was added to its attributes. The selector was created using this new class, but when replaying the macro, the class wasn’t present in the element being clicked, causing the selector to not match anything.
To resolve this issue, you can use the element’s id attribute instead of the .hover class for the selector. The id attribute is unique and will remain consistent, ensuring that the selector works as expected when replaying the macro. To update the selector, you can edit the macro step and replace the .hover class with the corresponding id attribute of the element. This should help to avoid the error and ensure the macro works correctly. For example, let’s say the HTML code for the clicked element looks like this:
In this case, the id attribute of the element is “example-button”. To create a CSS selector using the id, you would use the hash symbol # followed by the id value:
@snrxtreme Any thoughts on how could this issue be handled? Should we let user re-select elements visually? When in selection mode, the temporary class could be avoided easily and users and edit the selector visually.
[ you can skip reading this paragraph if you don’t want to understand why the error occurs]
The problem is that the selector generated is buggy because of the temporary class “.hover” added to the input element when you hover over it. As soon as you move your cursor away from the input box, the hover class is removed from the input box. so “.hover” as a selector will not match any element.
Can you try the following steps to resolve?
Click on the “three dots” in the “click step” that errored out.
Following selector was used to select the second item: .select2-results__options > li:nth-child(2)
Similarly, .select2-results__options > li:nth-child(3) can be used to select the third item in the list.