Table of Contents

Class Locator

Namespace
Cress.Recorder.Inference
Assembly
Cress.Recorder.dll

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

string

ClassName

public string? ClassName { get; init; }

Property Value

string

ControlType

public string? ControlType { get; init; }

Property Value

string

CssSelector

Raw CSS selector (web only; ignored by desktop drivers).

public string? CssSelector { get; init; }

Property Value

string

Label

Accessible label / aria-label / UIA Name-equivalent for labelled elements.

public string? Label { get; init; }

Property Value

string

Name

public string? Name { get; init; }

Property Value

string

Role

ARIA role / UIA ControlType cross-platform alias (e.g. "button", "textbox").

public string? Role { get; init; }

Property Value

string

TestId

Test data-attribute value (e.g. data-testid); maps to AutomationId for UIA.

public string? TestId { get; init; }

Property Value

string

Text

Visible text content of the element.

public string? Text { get; init; }

Property Value

string

XPath

Raw XPath expression (web only; ignored by desktop drivers).

public string? XPath { get; init; }

Property Value

string