Class ElementWrapper<TElement>
Defines a base wrapper for elements to expose platform element logic.
Inheritance
Implements
Namespace: Legerity
Assembly: Legerity.Core.dll
Syntax
public abstract class ElementWrapper<TElement> : object, IElementWrapper<TElement> where TElement : AppiumWebElement
Type Parameters
Name | Description |
---|---|
TElement | The type of |
Constructors
| Improve this Doc View SourceElementWrapper(TElement)
Initializes a new instance of the ElementWrapper<TElement> class.
Declaration
protected ElementWrapper(TElement element)
Parameters
Type | Name | Description |
---|---|---|
TElement | element | The |
Properties
| Improve this Doc View SourceElement
Gets the original TElement
reference object.
Declaration
public TElement Element { get; }
Property Value
Type | Description |
---|---|
TElement |
ElementDriver
Gets the driver used to find this element.
Declaration
public IWebDriver ElementDriver { get; }
Property Value
Type | Description |
---|---|
IWebDriver |
IsEnabled
Gets a value indicating whether the element is enabled.
Declaration
public virtual bool IsEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsVisible
Gets a value indicating whether the element is visible.
Declaration
public virtual bool IsVisible { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceClick()
Clicks the element.
Declaration
public virtual void Click()
FindElement(By)
Finds a child element by the specified locator.
Declaration
public AppiumWebElement FindElement(By locator)
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find a child element by. |
Returns
Type | Description |
---|---|
AppiumWebElement | The |
GetAttribute(String)
Gets the value of the specified attribute for this element.
Declaration
public string GetAttribute(string attributeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | The name of the attribute. |
Returns
Type | Description |
---|---|
System.String | The attribute's current value if it exists; otherwise, null. |
VerifyElementNotShown(By)
Determines whether the given element is not shown.
Declaration
public void VerifyElementNotShown(By locator)
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator for the element to locate. |
Exceptions
Type | Condition |
---|---|
ElementShownException | Thrown when the element is shown for the expected locator. |
VerifyElementShown(By)
Determines whether the given element is shown.
Declaration
public void VerifyElementShown(By locator)
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator for the element to find. |
Exceptions
Type | Condition |
---|---|
ElementNotShownException | Thrown when an element is not shown for the expected locator. |
VerifyElementShown(By, Nullable<TimeSpan>)
Determines whether the specified element is shown with the specified timeout.
Declaration
public void VerifyElementShown(By locator, TimeSpan? timeout)
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find a specific element. |
System.Nullable<TimeSpan> | timeout | The amount of time the driver should wait when searching for the |
Exceptions
Type | Condition |
---|---|
ElementNotShownException | Thrown when an element is not shown for the expected locator. |
VerifyElementsShown(By)
Determines whether the specified elements are shown.
Declaration
public void VerifyElementsShown(By locator)
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator for the element to find. |
Exceptions
Type | Condition |
---|---|
ElementsNotShownException | Thrown when no elements are shown for the expected locator. |
VerifyElementsShown(By, Nullable<TimeSpan>)
Determines whether the specified elements are shown with the specified timeout.
Declaration
public void VerifyElementsShown(By locator, TimeSpan? timeout)
Parameters
Type | Name | Description |
---|---|---|
By | locator | The locator to find a collection of elements. |
System.Nullable<TimeSpan> | timeout | The amount of time the driver should wait when searching for the |
Exceptions
Type | Condition |
---|---|
ElementsNotShownException | Thrown when no elements are shown for the expected locator. |