-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Selector to find any element by text/partial text? #2333
Comments
@peterjwest you can try |
This is really high in Google results, so here's a working example:
|
Thanks! |
@christian-bromann why were you not sure that it would work? Was it related to the version of Webdriverio used? |
The problem
I would like to query elements by text or partial text match without a restriction on element type. This is useful in cucumber steps such as
/^I click the "(.*)" button$/
, where the button could be implemented with an<a>
,<button>
or<input>
tag.I also may wish to look for text on a page e.g. "You have been logged out", but this could be embedded in almost any element, in which case it is not practical to enumerate all possible tags and search for the text with each one.
From the docs it doesn't look like this is possible without specifying an element type, is there a way? Can there be one?
Environment
The text was updated successfully, but these errors were encountered: