A Roslyn Analyzer for detecting duplicate XPath functions in the same class of the form "Locator(yourXpath);".
License
—
Deps
0
Install Size
—
Vulns
✓ 0
Published
Feb 12, 2026
$ dotnet add package XPathDuplicateAnalyzerA Roslyn Analyzer for detecting duplicate XPath functions in the same file of the form "PageDriver.RequestElement(yourXpath);".
Install the package from NuGet, clean your solution, rebuild it, and the analyzer will detect duplicate XPath functions in the same class.
Warnings will show up in the format:
Code: XPathDuplicate Description: FunctionName1 (line number) | FunctionName2 (line number)
This analyzer is built for C# projects using the Roslyn compiler. It uses the Roslyn API to analyze the syntax tree of your code and uses .Net Standard 2.0.
These two lines of code are considered duplicates because they both use the same XPath "//div[@name='uxThresholdFormat001SubmitButton']".
Line 35: public UIElement BtnSubTreshold00() => PageDriver.RequestElement("//div[@name='uxThresholdFormat001SubmitButton']");
Line 68: public UIElement TxtCurrTreshPerc00() => PageDriver.RequestElement("//input[@name='uxThresholdFormat001SubmitButton']");
Code: XPathDuplicate Description: BtnSubTreshold00 (35) | TxtCurrTreshPerc00 (68)