GetByRoleOptions Class

Configures LocatorScope.GetByRole: the states of the elements to find.

public sealed class GetByRoleOptions

Constructors

NameDescription
GetByRoleOptions()

GetByRoleOptions()

public GetByRoleOptions()

No documentation is available.

Properties

NameDescription
CheckedGets the checked state of the elements (aria-checked, or the state of a check box), or null to match any state.
DisabledGets the disabled state of the elements, or null to match any state.
ExactGets whether the name matches the whole accessible name, with the case. By default, the name matches a substring of the accessible name, ignoring the case. The white space is collapsed in both cases.
ExpandedGets the expanded state of the elements (aria-expanded), or null to match any state.
IncludeHiddenGets whether the elements that are hidden from the accessibility tree by visibility: hidden or aria-hidden="true" are found. The default is false. The role of an element that is not rendered (display: none) is none, so such an element is not found by its role: use a CSS locator.
LevelGets the level of the headings, list items, rows or tree items (aria-level, or the level of an h1-h6 element), or null to match any level.
PressedGets the pressed state of the toggle buttons (aria-pressed), or null to match any state.
SelectedGets the selected state of the elements (aria-selected, or the selectedness of an option), or null to match any state.

Gets the checked state of the elements (aria-checked, or the state of a check box), or null to match any state.

public bool? Checked { get; init; }

Property value

bool?

Gets the disabled state of the elements, or null to match any state.

public bool? Disabled { get; init; }

Property value

bool?

Gets whether the name matches the whole accessible name, with the case. By default, the name matches a substring of the accessible name, ignoring the case. The white space is collapsed in both cases.

public bool Exact { get; init; }

Property value

bool

Gets the expanded state of the elements (aria-expanded), or null to match any state.

public bool? Expanded { get; init; }

Property value

bool?

IncludeHidden

GetByRoleOptions.cs

Gets whether the elements that are hidden from the accessibility tree by visibility: hidden or aria-hidden="true" are found. The default is false. The role of an element that is not rendered (display: none) is none, so such an element is not found by its role: use a CSS locator.

public bool IncludeHidden { get; init; }

Property value

bool

Gets the level of the headings, list items, rows or tree items (aria-level, or the level of an h1-h6 element), or null to match any level.

public int? Level { get; init; }

Property value

int?

Gets the pressed state of the toggle buttons (aria-pressed), or null to match any state.

public bool? Pressed { get; init; }

Property value

bool?

Gets the selected state of the elements (aria-selected, or the selectedness of an option), or null to match any state.

public bool? Selected { get; init; }

Property value

bool?