microsoft / WinAppDriver

Windows Application Driver
MIT License
3.7k stars 1.41k forks source link

By XPath Does Not Find Legacy Attributes #292

Open brendanconnolly opened 7 years ago

brendanconnolly commented 7 years ago

Using an xpath selector cannot find elements by the legacy|Accessible attributes (using the pattern of LegacyName or LegacyValue) .

//does not work
private By childOfEdit= By.XPath("//Pane[@AutomationId='6']/Pane/Edit[@LegacyValue='foo']")

// but a partial xpath then linq query using get attribute does work.
private By editBoxes= By.XPath("//Pane[@AutomationId='6']/Pane/Edit")

var thisOneWorks= editBoxes.First(x=>x.GetAttribute("LegacyValue")=="foo");

While Linq works, it limits the options available. For example you can't get the parent of the element I found via linq...

hassanuz commented 7 years ago

Hi @brendanconnolly, can you please share what version of WinAppDriver are you running?

brendanconnolly commented 7 years ago

v1.0-RC2 haven't tried on the official release yet.

hassanuz commented 7 years ago

Hi @brendanconnolly , those attributes are currently not supported through xpath, but we've noted this as a feature enhancement.

varun210619 commented 4 years ago

Hi @hassanuz Is there any progress on this feature enhancement. The issue is opened since 2 years :(