Class ElementWrapperExtensions
Defines a collection of extensions for
Inheritance
Namespace: Legerity.Uno.Extensions
Assembly: Legerity.Uno.dll
Syntax
public static class ElementWrapperExtensions : object
Methods
| Improve this Doc View SourceFindElementByAutomationId(UnoElementWrapper, String)
Finds the first element under the given element that matches the given automation identifier.
To find element for platforms supported by Uno, set the following in your App.xaml.cs constructor.
Uno.UI.FrameworkElementHelper.IsUiAutomationMappingEnabled = true;
For improvements to finding elements for web applications, also set the following in your App.xaml.cs constructor.
Uno.UI.FeatureConfiguration.UIElement.AssignDOMXamlName = true;
Declaration
public static RemoteWebElement FindElementByAutomationId(this UnoElementWrapper element, string automationId)
Parameters
Type | Name | Description |
---|---|---|
UnoElementWrapper | element | The element. |
System.String | automationId | The automation identifier. |
Returns
Type | Description |
---|---|
RemoteWebElement | The |
FindElementByXamlName(UnoElementWrapper, String)
Finds the first Uno Platform web element under the given element that matches the given x:Name value.
To find elements with this method for web applications, set the following in your App.xaml.cs.
Uno.UI.FeatureConfiguration.UIElement.AssignDOMXamlName = true;
Declaration
public static RemoteWebElement FindElementByXamlName(this UnoElementWrapper element, string name)
Parameters
Type | Name | Description |
---|---|---|
UnoElementWrapper | element | The web element. |
System.String | name | The x:Name of the element to find. |
Returns
Type | Description |
---|---|
RemoteWebElement | The |
FindWebElementByXamlType(UnoElementWrapper, String)
Finds the first Uno Platform web element under the given element that matches the given XAML type.
Declaration
public static RemoteWebElement FindWebElementByXamlType(this UnoElementWrapper element, string xamlType)
Parameters
Type | Name | Description |
---|---|---|
UnoElementWrapper | element | The web element. |
System.String | xamlType | The XAML type. Windows control types can be referenced by the element wrapper's WindowsType value. |
Returns
Type | Description |
---|---|
RemoteWebElement | The |
VerifyNameOrAutomationIdContains(UnoElementWrapper, String)
Verifies the elements name or Automation ID based on the given partial compare value.
Declaration
public static bool VerifyNameOrAutomationIdContains(this UnoElementWrapper element, string compare)
Parameters
Type | Name | Description |
---|---|---|
UnoElementWrapper | element | The element to verify. |
System.String | compare | The partial value to verify is the name or Automation ID. |
Returns
Type | Description |
---|---|
System.Boolean | True if the element's name or Automation ID matches partially; otherwise, false. |
VerifyNameOrAutomationIdEquals(UnoElementWrapper, String)
Verifies the elements name or AutomationId based on the given compare.
Declaration
public static bool VerifyNameOrAutomationIdEquals(this UnoElementWrapper element, string compare)
Parameters
Type | Name | Description |
---|---|---|
UnoElementWrapper | element | The element to verify. |
System.String | compare | The value to verify is the name or AutomationId. |
Returns
Type | Description |
---|---|
System.Boolean | True if the element's name or AutomationId matches; otherwise, false. |
WaitUntil<TElementWrapper>(TElementWrapper, Func<TElementWrapper, Boolean>, Nullable<TimeSpan>)
Waits until a specified element condition is met, with an optional timeout.
Declaration
public static void WaitUntil<TElementWrapper>(this TElementWrapper element, Func<TElementWrapper, bool> condition, TimeSpan? timeout = null)
where TElementWrapper : UnoElementWrapper
Parameters
Type | Name | Description |
---|---|---|
TElementWrapper | element | The element to wait on. |
Func<TElementWrapper, System.Boolean> | condition | The condition of the element to wait on. |
System.Nullable<TimeSpan> | timeout | The optional timeout wait on the condition being true. |
Type Parameters
Name | Description |
---|---|
TElementWrapper | The type of UnoElementWrapper. |