-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Polyfill for nth-match CSS 4 selector #891
Comments
Let's also enable |
I'm running into a problem with this right now. Is this issue scoped for any future release? |
@jkwaldrip this wasn't really high on my prio list. Happy to receive PRs for that. You can work around this now by doing: const comparators = $$('select.comparators');
comparators[2].selectByValue('Some value'); |
@christian-bromann Thanks, I've added an update on #1140 for the issue I was encountering with setValue() in case anyone else runs into it. |
This should probably be closed. Though, getting support for the |
agree with @BlueRaja. My workaround above is actually the valid solution. You can also use const results = $$('.commands.property a').filter(function (link) {
return link.isVisible();
}); |
It would be nice to have the nth-match pseudo-selector polyfill when using WebdriverIO.
In jQuery, this can easily be achieved programatically with something like:
$('elem.someclass').eq(2)
, but it would require using messy xPath in the current version of WebdriverIO, because the nth element of.someclass
can't be selected using any other CSS selector except for currently unavailable CSS 4nth-match
.There's the
elements
protocol, but there's no way to send the nth element from that to another command.It would be nice to either have that polyfill like this:
Which could be polyfilled by using the
this.elements
protocol and selecting theWebElement JSON
index from what is asked for in nth-match. If there's nonth-match
in the selector, it can just default to it's current behavior and usethis.element
.Or something generic and similar to jQuery, which would detect if the selector argument is left out and would attempt to read the result from the previous promise, such as this:
The text was updated successfully, but these errors were encountered: