Skip to content

[Feature] A special locator to visually locate an element #2877

Closed
@idxn

Description

@idxn

Let us know what functionality you'd like to see in Playwright and what is your use case.
A special locator to visually locate an element.

In taiko, browser automation library by thoughtwork, you could locate element visually like the following:
click(checkbox(near("Username")))

Taiko calls it proximity locator
Refer: https://docs.taiko.dev/#smart-selectors

This locator will reduce the flakiness of the script and the maintenance cost because the locator doesn't rely on html structure that may be changed from time to time. Even we can assign data-testid attribute but this is very useful in some cases as well.

Do you think others might benefit from this as well?
Yes, it is.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions