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

CSS

Use CSS selectors to locate elements based on their styling properties and structure in the DOM.

CSS selectors find Elements by tag, class, ID, attributes, and hierarchy. They use the same syntax as stylesheets and are fast to write when the page structure is stable.

Use CSS when classes, IDs, or attributes clearly identify the control. When your application exposes dedicated test attributes, prefer Test ID for longer-lasting tests.

See Creating Elements to add a Manual Element with a CSS selector.

Examples:

  • button.primary

  • #submit-button

  • input[name="email"]

  • div.container > ul > li:first-child

When the control sits inside Shadow DOM, prefix the CSS with >>>. See Shadow DOM.

Last updated