Supported strategies
Appium Vega Driver supports UiSelector and XML Path Language (XPath). This release doesn’t support other selector strategies.UiSelector
A platform-specific locator strategy that uses native automation frameworks to identify UI elements. It provides precise control over element selection based on properties and hierarchical relationships. Example usage:XPath
A query language that enables navigation and selection of elements in an XML-like structure. Example usage:Key components
-
Axis - Specifies the direction of the search, such as descendant, ancestor, and following.
-
Node test - Specifies the node type to select, such as element, attribute, or text().
-
Predicate - Filters the selected nodes that are based on various conditions, such as attribute values, position, or custom functions.
Special use cases
Comparison of selector strategies
Best practices
-
Choose the right strategy
- Use UiSelector for platform-specific tests
- Use XPath for cross-platform compatibility
- Prefer UiSelector when performance is critical
-
Element location
- Use unique identifiers when possible
- Avoid absolute paths
- Keep selectors as simple as possible
- Regularly validate selectors’ reliability
-
Performance considerations
- Complex XPath queries may impact test execution time
- Cache frequently used elements
- Use app-specific IDs when available
-
Maintenance tips
- Document locator strategies
- Review locators regularly
- Update with UI changes
- Maintain cross-platform compatibility
- Use meaningful names in test code

