When testing dynamic elements of your site, it's helpful to verify that an item is no longer visible or available to the user. A great tool for testing this type of behavior is called "Not on Page" in Architect. This can be useful for confirming proper navigation between site pages, pop-up windows, and items like context-based state changes in menus.
Verifying an Element is Not on the Page
- Start a new test with Architect.
- Determine the element which will be verified as not on the page, such as this cookie banner. Add a Verify action for the element.
- Open the details for the verify action by clicking the white circle.
- Open the ADV Selector tab. Copy the path in the Current element field. Close the details panel.
- Continue the flow to dismiss or hide the element. For the example, click the Accept button on the banner.
- Click the blue + button to open the Action panel.
- Select Not On Page.
- Enter the xpath for the element copied from the Verify action into the Search Selector Expression text box. You also have the option of entering an Attribute, an Operator, and the Element Value for a stronger search. Click Continue.
- Continue recording your test and Save it.
- On execution, it will verify the element is not found on the page.
Note: Sometimes due to animations or network traffic, the Not on page Action performs before the element is no longer visible. It can be helpful to add a short Wait Action allowing a little leeway to ensure your site is operating as intended.