ElementExtensions Class
public static class ElementExtensionsMethods
| Name | Description |
|---|---|
| CheckAsync(Element, CancellationToken) | Checks the check box or the radio button with a click. |
| ClickAsync(Element, ClickOptions?, CancellationToken) | Clicks the element at its center. |
| DoubleClickAsync(Element, CancellationToken) | Double-clicks the element. |
| FillAsync(Element, string, CancellationToken) | Replaces the value of the text field with a text typed with the keyboard, then leaves the field. |
| GetAccessibilitySnapshot(Element) | Gets the accessibility tree of the element, as a YAML snapshot (the format of the ARIA snapshots of Playwright). |
| GetMarkup(Element, MarkupOptions?) | Gets the HTML of the element, formatted for snapshots. |
| HoverAsync(Element, CancellationToken) | Moves the mouse over the element. |
| SelectOptionAsync(Element, string[]) | Selects options of the select element by value. |
| TapAsync(Element, CancellationToken) | Taps the element with a finger. |
| TypeAsync(Element, string, CancellationToken) | Focuses the element with a click and types a text with the keyboard. |
| UncheckAsync(Element, CancellationToken) | Unchecks the check box with a click. |
CheckAsync(Element, CancellationToken)
ElementExtensions.csChecks the check box or the radio button with a click.
public static Task CheckAsync(this Element element, CancellationToken cancellationToken = default)Parameters
elementElement- The input element.
cancellationTokenCancellationToken- A token to cancel the wait.
Returns
Task A task completed once the components are idle.
ClickAsync(Element, ClickOptions?, CancellationToken)
ElementExtensions.csClicks the element at its center.
public static Task ClickAsync(this Element element, ClickOptions? options = null, CancellationToken cancellationToken = default)Parameters
elementElement- The element.
optionsClickOptions?- The options, or null for the default options.
cancellationTokenCancellationToken- A token to cancel the wait.
Returns
Task A task completed once the components are idle.
DoubleClickAsync(Element, CancellationToken)
ElementExtensions.csDouble-clicks the element.
public static Task DoubleClickAsync(this Element element, CancellationToken cancellationToken = default)Parameters
elementElement- The element.
cancellationTokenCancellationToken- A token to cancel the wait.
Returns
Task A task completed once the components are idle.
FillAsync(Element, string, CancellationToken)
ElementExtensions.csReplaces the value of the text field with a text typed with the keyboard, then leaves the field.
public static Task FillAsync(this Element element, string text, CancellationToken cancellationToken = default)Parameters
elementElement- The text field.
textstring- The text.
cancellationTokenCancellationToken- A token to cancel the wait.
Returns
Task A task completed once the components are idle.
GetAccessibilitySnapshot(Element)
ElementExtensions.csGetMarkup(Element, MarkupOptions?)
ElementExtensions.csGets the HTML of the element, formatted for snapshots.
public static string GetMarkup(this Element element, MarkupOptions? options = null)Parameters
elementElement- The element.
optionsMarkupOptions?- The options, or null for the default options.
Returns
string The HTML.
HoverAsync(Element, CancellationToken)
ElementExtensions.csMoves the mouse over the element.
public static Task HoverAsync(this Element element, CancellationToken cancellationToken = default)Parameters
elementElement- The element.
cancellationTokenCancellationToken- A token to cancel the wait.
Returns
Task A task completed once the components are idle.
SelectOptionAsync(Element, string[])
ElementExtensions.csTapAsync(Element, CancellationToken)
ElementExtensions.csTaps the element with a finger.
public static Task TapAsync(this Element element, CancellationToken cancellationToken = default)Parameters
elementElement- The element.
cancellationTokenCancellationToken- A token to cancel the wait.
Returns
Task A task completed once the components are idle.
TypeAsync(Element, string, CancellationToken)
ElementExtensions.csFocuses the element with a click and types a text with the keyboard.
public static Task TypeAsync(this Element element, string text, CancellationToken cancellationToken = default)Parameters
elementElement- The element.
textstring- The text.
cancellationTokenCancellationToken- A token to cancel the wait.
Returns
Task A task completed once the components are idle.
UncheckAsync(Element, CancellationToken)
ElementExtensions.csUnchecks the check box with a click.
public static Task UncheckAsync(this Element element, CancellationToken cancellationToken = default)Parameters
elementElement- The input element.
cancellationTokenCancellationToken- A token to cancel the wait.
Returns
Task A task completed once the components are idle.