# Locator

A way to find elements by role, label or text.

## What is **Locator**?

Used in Playright, it finds elements the way a user would, by role, label or text, and waits for them automatically.

```typescript
page.getByRole('button', { name: 'Save' })
```

Level: Freelancer · [More Unit Testing terms at this level](https://www.ask-codey.com/glossary/subjects/unit-testing/freelancer)

Updated: October 16, 2026

Source: https://www.ask-codey.com/glossary/locator
