For the complete documentation index, see llms.txt. This page is also available as Markdown.

Test ID

Locate elements using custom Test ID attributes added specifically for testing.

Test ID finds Elements by attributes added for testing. These selectors stay stable when classes, layout, or visible copy change, so they are the preferred choice for durable tests.

DoesQA searches for the following test-ids matching the given text:

'data-test'
'data-testid'
'data-test-id'
'data-qa'
'data-qa-id'
'data-at'
'data-at-id'
'data-dqa'
'data-dqa-id'
'data-trackable'
'data-dyn-controlname'
'data-dyn-role'
'data-site-id'

Ask your development team to add one of these attributes to controls you interact with often. See Creating Elements to add a Manual Element with a Test ID selector.

Examples:

  • [data-testid="login-button"]

  • [data-test="product-card-1"]

  • [data-test-id="cart-item-count"]

  • [data-qa="error-message"]

Last updated