Smart locator resolver for Appium and Robot Framework
Project description
robotframework-appium-smartlocator
Smart locator resolver for Appium and Robot Framework.
Overview
This library resolves mobile elements from human-readable descriptions and automatically generates the best locator strategy based on the current Appium page source.
It is designed primarily for Android mobile automation using Appium and Robot Framework.
Features
- Human-readable element description (e.g. "botao continuar")
- Semantic parsing of element type and identifier
- Intelligent candidate scoring based on XML attributes
- Automatic locator generation (id, accessibility, UIAutomator, XPath)
- Seamless integration with Robot Framework
- Works with Appium mobile automation
Installation
From PyPI (future)
pip install robotframework-appium-smartlocator
Local development
pip install -e .
Project Structure
robotframework-appium-smartlocator/
├── appium_smartlocator/
│ ├── __init__.py
│ ├── semantic_parser.py
│ ├── element_resolver.py
│ ├── locator_builder.py
│ ├── smart_element_resolver.py
│ └── smart_robot_library.py
├── pyproject.toml
└── README.md
Usage in Robot Framework
Import the library
*** Settings ***
Library AppiumSmartLocator
Available Keywords
Resolver Locator InteligenteClicar No ElementoPreencher ElementoValidar Elemento
Basic Example
*** Settings ***
Library appium_smartlocator.AppiumSmartLocator
*** Test Cases ***
Validate Button
Validar Elemento botao continuar
Example: Login Flow
*** Settings ***
Library AppiumSmartLocator
*** Test Cases ***
Login Example
Preencher Elemento campo usuario meu_usuario
Preencher Elemento campo senha minha_senha
Clicar No Elemento botao entrar
How It Works
- The library parses a human-readable description
- Identifies element type and target text
- Scans the Appium XML page source
- Scores possible candidates
- Selects the best match
- Builds an optimized locator
Locator Priority
The library generates locators in this order:
resource-id(best)accessibility idUiSelector (Android)XPath- fallback (
//*)
Requirements
- Python 3.10+
- Robot Framework
- Appium
- Android device/emulator
- Appium page source available via driver
Development Status
Current version: 0.1.3
This is the first functional version of the library.
Planned improvements:
- Smarter fallback strategies
- Better scoring logic
- Improved logging/debugging
- Support for more complex layouts
- Possible iOS support in future
Author
Paulo Rocha
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file robotframework_appium_smartlocator-0.1.5.tar.gz.
File metadata
- Download URL: robotframework_appium_smartlocator-0.1.5.tar.gz
- Upload date:
- Size: 4.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3482a8ef55599c8e77b85575f274c8d2b8c559f2c4df119d4b8e425f803221db
|
|
| MD5 |
1a275cbc2b5b6c9721ad49302f0622db
|
|
| BLAKE2b-256 |
f42591f2d6f55f5b398b62f5d35a8c8c2562e36f5935ad8e37c031f793f8cecf
|
File details
Details for the file robotframework_appium_smartlocator-0.1.5-py3-none-any.whl.
File metadata
- Download URL: robotframework_appium_smartlocator-0.1.5-py3-none-any.whl
- Upload date:
- Size: 5.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b06c7cc89ae35204d78bde1a0378aedadbbfe6fdf05775f6c8e17bcb717083df
|
|
| MD5 |
6d874b81fc23c6d9f7c1a386f6fed308
|
|
| BLAKE2b-256 |
edeb459af2d8aa298f3300a6b577e25112aa54460786c60763ea7d02b68174bd
|