Class AppElementDescription
The Object Description how to identify the UI Elemen for native Mobile Application
Inherited Members
Namespace: AxaFrance.WebEngine.MobileApp
Assembly: AxaFrance.WebEngine.MobileApp.dll
Syntax
public class AppElementDescription : ElementDescription
Constructors
| Edit this page View SourceAppElementDescription()
Initialize the element description. If the element is not part of PageObject, you need to call UseDriver(WebDriver) to indicate with WebDriver will be used.
Declaration
public AppElementDescription()
AppElementDescription(WebDriver)
Initialize the element description using given WebDriver
Declaration
public AppElementDescription(WebDriver driver)
Parameters
| Type | Name | Description |
|---|---|---|
| WebDriver | driver | WebDriver instance |
Properties
| Edit this page View SourceAccessbilityId
To identify element via it's AccessibilityId. Id and AccessibilityId can't be used in the same time.
Declaration
public string AccessbilityId { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
AndroidDataMatcher
Using Android DataMatcher selector, only available for Android applications (Espresso). When using AndroidDataMatcher, other locators will be ignored.
Declaration
public string AndroidDataMatcher { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ClassName
Classname of the element.
Declaration
public string ClassName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ContentDescription
To identify elements via it's content-desc. Name and ContentDescription can't be used in the same time.
Declaration
public string ContentDescription { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Id
Identifier of the element
Declaration
public string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ImageLocator
Using Image element matching (AI-based element finding). Useful when standard locators don't work. Requires Appium image plugin.
Declaration
public string ImageLocator { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
IosClassChain
Using IOS Class Chain, only avaiable for iOS applications. When using IosClassChain, other locators will be ignored..
Declaration
public string IosClassChain { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
IosPredicate
Using iOS NSPredicate string, only available for iOS applications. When using IosPredicate, other locators will be ignored. More powerful than IosClassChain for complex queries.
Declaration
public string IosPredicate { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Name
The Name property of the element. Name and ContentDescription can't be used in the same time, or Name attribute will be ignored.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Text
Text of Innertext of the element
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
UIAutomatorSelector
Using UIAutomator selector, only avaiable for Android applications. When using UIAutomator selector, other locators will be ignored.
Declaration
public string UIAutomatorSelector { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
XPath
XPath of the element. Please avoid to use XPATH if another identification approche is available.
Declaration
public string XPath { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceApplyAttribute(FindsByAttribute)
Applies the locator defined in FindsByAttribute. this function is called automatically before InternalFindElements()
Declaration
public override void ApplyAttribute(FindsByAttribute attr)
Parameters
| Type | Name | Description |
|---|---|---|
| FindsByAttribute | attr |
Overrides
| Edit this page View SourceDoubleTap()
Performs a double tap on the current element (useful for zoom, selection, special interactions)
Declaration
public void DoubleTap()
DragAndDropTo(AppElementDescription)
Drags the current element and drops it at a target element (useful for reordering lists, moving items)
Declaration
public void DragAndDropTo(AppElementDescription target)
Parameters
| Type | Name | Description |
|---|---|---|
| AppElementDescription | target | The target element to drop onto |
HideKeyboard()
Hides the on-screen keyboard (works on both Android and iOS)
Declaration
public void HideKeyboard()
InternalFindElement()
Implemente element identifying algorithm, without the need of object synchronization.
Declaration
protected override IWebElement InternalFindElement()
Returns
| Type | Description |
|---|---|
| IWebElement | Identified test object. |
Overrides
| Edit this page View SourceInternalFindElements()
Implemente element identifying algorithm, without the need of object synchronization.
Declaration
protected override IReadOnlyCollection<IWebElement> InternalFindElements()
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<IWebElement> | Identified test objects |
Overrides
| Edit this page View SourceInternalGetScreenshot()
Implemente screenshot generation for the current specific element
Declaration
protected override byte[] InternalGetScreenshot()
Returns
| Type | Description |
|---|---|
| byte[] | The screenshot image in RAW Binary data format. |
Overrides
| Edit this page View SourceLongPress(int)
Performs a long press on the current element (useful for context menus, drag operations)
Declaration
public void LongPress(int durationSeconds = 2)
Parameters
| Type | Name | Description |
|---|---|---|
| int | durationSeconds | Duration of the press in seconds (default: 2) |
ScrollDown()
Scroll the screen downward
Declaration
public void ScrollDown()
ScrollIntoView(ScrollDirection, int)
Tries to bring current element into viewport. This method will scroll the page multiple times to make the element visible. If after the maximum scroll action and the element is still not visible, the method will return false.
Declaration
public bool ScrollIntoView(ScrollDirection direction, int maxSwipe = 10)
Parameters
| Type | Name | Description |
|---|---|---|
| ScrollDirection | direction | The direction of the scroll |
| int | maxSwipe | The maximum number of swipe action to make the element visible |
Returns
| Type | Description |
|---|---|
| bool | True if the element is visible after scrolling. False when the element is not visible. |
ScrollIntoView(int)
Tries to bring current element into viewport. This method will scroll down the page multiple times to make the element visible. If after the maximum scroll action and the element is still not visible, the method will return false.
Declaration
public bool ScrollIntoView(int maxSwipe = 10)
Parameters
| Type | Name | Description |
|---|---|---|
| int | maxSwipe |
Returns
| Type | Description |
|---|---|
| bool | True if the element is visible after scrolling. False when the element is not visible. |
ScrollUp()
Scroll the screen upward
Declaration
public void ScrollUp()
SwipeLeft()
Swipe left on the screen (useful for carousels, horizontal lists, dismissible cards)
Declaration
public void SwipeLeft()
SwipeRight()
Swipe right on the screen (useful for carousels, horizontal lists, navigation)
Declaration
public void SwipeRight()
ToString()
Shows a string representation of this AppElementDescription
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string representation of this AppElementDescription |
Overrides
WaitUntilClickable(int)
Waits until the element is clickable (visible and enabled)
Declaration
public bool WaitUntilClickable(int timeoutSeconds = 10)
Parameters
| Type | Name | Description |
|---|---|---|
| int | timeoutSeconds | Maximum wait time in seconds |
Returns
| Type | Description |
|---|---|
| bool | True if element became clickable, false otherwise |