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

Question: how to select the first (or nth) match? #92

Closed
beck opened this issue Jun 3, 2022 · 2 comments
Closed

Question: how to select the first (or nth) match? #92

beck opened this issue Jun 3, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@beck
Copy link

beck commented Jun 3, 2022

I currently have a failing test that uses semantic locators and the failure is:

matched 2 elements, but expected to match 1

Is there a way to say take the first? Or n'th?

@beck beck added the bug Something isn't working label Jun 3, 2022
@beck
Copy link
Author

beck commented Jun 7, 2022

This is not possible with how SL is currently spec'd.

@beck beck closed this as completed Jun 7, 2022
@AlexLloyd0
Copy link
Contributor

For anyone who finds this issue in the future:
This error message came from a framework which uses Semantic Locators.

  • findElementsBySemanticLocator returns an array of all matching elements, which can be indexed like a normal array
  • findElementBySemanticLocator returns the first matching element

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants