> For the complete documentation index, see [llms.txt](https://docs.does.qa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.does.qa/elements/selector-types.md).

# Selector Types

A [Selector](/getting-started/terminology.md) is the rule inside an [Element](/getting-started/terminology.md) that finds it on the page.

Use this page when you already know you are creating a **Manual** Element and need to pick a **Type**. To create the Element (Automatic or Manual), see [Creating Elements](/elements/creating-elements.md). To choose Selectors that stay stable as the page changes, see [Choose durable selectors](/better-coverage/choose-durable-selectors.md).

| Selector type                                            | Best when                                                                    |
| -------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [Test ID](/elements/selector-types/test-id.md)           | Your application exposes dedicated test attributes (preferred for stability) |
| [CSS](/elements/selector-types/css.md)                   | The page has clear classes, IDs, or attributes                               |
| [Shadow DOM](/elements/selector-types/shadow-dom.md)     | The control lives inside a Shadow DOM tree (CSS with a `>>>` prefix)         |
| [Visible Text](/elements/selector-types/visible-text.md) | The control is best found by the text a user can see                         |
| [XPath](/elements/selector-types/xpath.md)               | You need to move through the DOM or match on text relationships              |

Prefer [Test ID](/elements/selector-types/test-id.md) when your team can add test attributes to the application. Use Selectors that describe the Element you mean to use, not incidental layout wrappers. When a click or check fails, open the Element and confirm both the Selector type and the selector value still match the page.

## Related

* [Creating Elements](/elements/creating-elements.md)
* [Choose durable selectors](/better-coverage/choose-durable-selectors.md)
* [Shadow DOM](/elements/selector-types/shadow-dom.md)
* [Terminology](/getting-started/terminology.md)
