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

Optimize FindByLabelStrategy to use one composite XPath query #739

Closed
YevgeniyShunevych opened this issue Jan 29, 2023 · 0 comments
Closed
Assignees
Milestone

Comments

@YevgeniyShunevych
Copy link
Member

Before this change, three WebDiver commands were executed to find a component by label using [FindByLabel]attribute:

  1. Find a label.
  2. Get label's for attribute value.
  3. Find a component by id equal to for value.

Now FindByLabelStrategy is optimized to use composite XPath query in a form:

(.//*[@id = //label[normalize-space(.) = 'LABEL_TEXT']/@for]/descendant-or-self::input[@type='text' or not(@type)] | .//label[normalize-space(.) = 'LABEL_TEXT']/descendant-or-self::input[@type='text' or not(@type)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant