Class Locator
Describes which element to act on. All fields are nullable; at least one of AutomationId or Name should be non-null for the locator to be useful at replay time.
public sealed record Locator : IEquatable<Locator>
- Inheritance
-
Locator
- Implements
- Inherited Members
Properties
AutomationId
public string? AutomationId { get; init; }
Property Value
ClassName
public string? ClassName { get; init; }
Property Value
ControlType
public string? ControlType { get; init; }
Property Value
CssSelector
Raw CSS selector (web only; ignored by desktop drivers).
public string? CssSelector { get; init; }
Property Value
Label
Accessible label / aria-label / UIA Name-equivalent for labelled elements.
public string? Label { get; init; }
Property Value
Name
public string? Name { get; init; }
Property Value
Role
ARIA role / UIA ControlType cross-platform alias (e.g. "button", "textbox").
public string? Role { get; init; }
Property Value
TestId
Test data-attribute value (e.g. data-testid); maps to AutomationId for UIA.
public string? TestId { get; init; }
Property Value
Text
Visible text content of the element.
public string? Text { get; init; }
Property Value
XPath
Raw XPath expression (web only; ignored by desktop drivers).
public string? XPath { get; init; }