Debugging sequences

Sequence bug: "Node is either not visible or not an HTMLElement"

If the error message "Node is either not visible or not an HTMLElement" appears when setting up a sequence, it may be because the XPath Selector cannot find the element, in our example "//button/span[contains(text(), "Add to cart")]" in the source code. One reason for this could be that the specified XPath exists several times in the code, but the first one is not visible in the browser, and the search is aborted. 
However, it is possible to find the exact XPath by specifying it as follows

(//button/span[contains(text(), "Add to cart")])[2]
Table of contents