# Choosing a Locator Strategy > **When to use**: When deciding which Playwright locator method to use for an element ## Quick Answer Use `getByRole()` for everything that has a semantic HTML role (buttons, links, headings, form fields, dialogs). Fall back to `getByLabel()` for form fields, `getByText()` for plain content, and `getByTestId()` only as a last resort for custom components with no accessible role. ## Decision Flowchart ``` Start: You need to locate an element | v Does the element have a semantic role? (button, link, heading, textbox, checkbox, combobox, dialog, img, row, cell, navigation...) | +-- YES --> Use getByRole('role', { name: 'accessible name' }) | | | +-- Need to narrow scope? Chain from a parent role locator: | getByRole('navigation').getByRole('link', { name: '...' }) | +-- NO | v Is it a form field with a visible