Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
idxn opened this issue Jul 8, 2020 · 2 comments
Open

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

idxn opened this issue Jul 8, 2020 · 2 comments

Comments

@idxn
Copy link

@idxn idxn commented Jul 8, 2020

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

@mxschmitt
Copy link
Contributor

@mxschmitt mxschmitt commented Jul 8, 2020

Have you seen already the selector documentation? Text, css, xpath, shadow dom selectors are available: https://playwright.dev/#version=v1.2.0&path=docs%2Fselectors.md&q=

Does this fit for your needs?

A feature for highlighting a certain dom node will be tracked here: #2747

@idxn
Copy link
Author

@idxn idxn commented Jul 8, 2020

Yes, I have seen it and it still doesn't fit my need. I would love to see this feature.
BTW, thanks for pointing #2747. That is also useful.

Last but not least, thanks for a great library. I also saw you python version. Hopefully, we can have a production version soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.