Microsoft

Sample XPath utility for Coded UI Test

Dec 28, 2011Gautam Goenka [MSFT]
Sample XPath utility for Coded UI Test
SummaryAI, from the source post

Introduced a sample utility that adds XPath query support to Coded UI Test for searching controls. This utility provides two extension methods, `FindFirstByXPath` and `FindAllByXPath`, to the `UITestControl` class. It leverages the built-in XPath parser and .NET classes, conforming to .NET's XPath Syntax. The post highlights two key limitations: a semantic difference in search (depth-first vs. breadth-first) and a performance penalty compared to the built-in search. It advises prudent use of this utility, recommending it for scenarios where the ease of use and power of XPath are critical and the control tree is not excessively deep.

More from the Coded UI Test Deprecation and Alternatives trail