class Playwright::Page

def get_by_test_id(testId)

By default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to configure a different test id attribute if necessary.

**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