Skip to content

Optimize FindByLabelStrategy to use one composite XPath query #739

@YevgeniyShunevych

Description

@YevgeniyShunevych

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)])

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions