class Playwright::Page
def get_by_test_id(testId)
**Details**
```
page.get_by_test_id("directions").click()
```python sync
You can locate the element by it's test id:
```
```html
Consider the following DOM structure.
**Usage**
Locate element by the test id.
def get_by_test_id(testId) wrap_impl(@impl.get_by_test_id(unwrap_impl(testId))) end