Sample XPath utility for Coded UI Test
Dec 28, 2011Gautam Goenka [MSFT]

Summary
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
- Changes to Coded UI Test in Visual Studio 2019
- Troubleshooting launch issues with xaml based apps using Coded UI Test
- Coded UI Test Extensibility V2
- Coded UI testing support for Silverlight using Visual Studio 2013
- Test controllers are not visible or marked offline in MTM when multiple versions of MTM are installed