Accessibility attributes
Leveraging accessibility attributes such as
aria-roles
, aria-labels
, and
alt text is an existing best practice
in testing. If your app is not accessible, we recommend adding these
attributes to improve UX and comply with ADA
standards.
HTML content and attributes
If the desired element contains text content, you can also include a subset or summary of the text in your description. For example, the “the ‘Welcome’ header” or “the text area containing ‘Lorem Ipsum’”. Momentic’s AI also looks at certain high-signal HTML attributes. Values that are flagged as auto-generated, sensitive, or lengthy are ignored.Included HTML attributes
Included HTML attributes
Exact matches
Momentic’s AI is trained to treat single quotation marks as an exact match. As such, the description “the ‘Submit’ button” will never match a button with content ‘Approve’. If quotation marks are not provided, Momentic’s AI will try to use the context available on the page to infer the correct element.Visual information
Momentic’s AI can access HTML and a11y tree for the entire page, not just
the current visible viewport. However, it can only access visual information
from the current visible viewport as it relies on a screenshot of the page.
Positional cues
Wen there are multiple instances of the same element (e.g. a data table or list), you will need to disambiguate which instance you want to interact with.Absolute locations
You can provide absolute cues such as “…at the top of the page” or “…in the bottom right corner”.Relative locations
You can provide relative cues such as “…below the ‘Introduction’ header” or “…beside the ‘Back’ button”. Use the inside keyword to specify the parent element of another element. For example, “the ‘Submit’ button inside the user dialog”. Use the closest keyword to specify the closest element to another element. For example, “the closest ‘Submit’ button to the ‘Username’ input”.Ordering
Since the order of elements on the page can change, make sure to turn off
caching. This will ensure Momentic’s AI will always target the
correct element
Dynamic elements
Since the target element will change every time, make sure to turn off
caching. This will ensure Momentic’s AI will always target the
correct element
Examples

- “the avatar picture on the top left corner”
- “the home link in the sidebar”
- “the ‘Amount’ filter menu”
- “the notification bell icon to the right of the green button”
- “the third outgoing transaction card in the list”
Troubleshooting
- Dynamic elements: If you use nth or dynamic elements in a description, make sure to turn off caching. This will ensure Momentic’s AI will always target the correct element.
- Hidden elements: Momentic’s AI will ignore elements that are explicitly marked as
aria-hidden
(or are part of sub-trees that are hidden), not attached to the DOM, or have no bounding box. - Multiple matches: If Momentic’s AI finds multiple elements that match your description, it will select the first one in the DOM order. If you want to target a specific instance, use positional cues like nth, closest, or inside.