Skip to main content

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    appium_smartlocator.SmartMobileLibrary

Available Keywords

  • Resolver Locator Inteligente
  • Clicar No Elemento
  • Preencher Elemento
  • Validar Elemento

Basic Example

*** Settings ***
Library    appium_smartlocator.SmartMobileLibrary

*** Test Cases ***
Validate Button
    Validar Elemento    botao continuar

Example: Login Flow

*** Settings ***
Library    appium_smartlocator.SmartMobileLibrary

*** Test Cases ***
Login Example
    Preencher Elemento    campo usuario    meu_usuario
    Preencher Elemento    campo senha      minha_senha
    Clicar No Elemento    botao entrar

How It Works

  1. The library parses a human-readable description
  2. Identifies element type and target text
  3. Scans the Appium XML page source
  4. Scores possible candidates
  5. Selects the best match
  6. Builds an optimized locator

Locator Priority

The library generates locators in this order:

  1. resource-id (best)
  2. accessibility id
  3. UiSelector (Android)
  4. XPath
  5. fallback (//*)

Requirements

  • Python 3.10+
  • Robot Framework
  • Appium
  • Android device/emulator
  • Appium page source available via driver

Development Status

Current version: 0.1.0

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

robotframework_appium_smartlocator-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file robotframework_appium_smartlocator-0.1.0.tar.gz.

File metadata

File hashes

Hashes for robotframework_appium_smartlocator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3b0aa9e17e34a4c6cbcbe45bdc3947b46efb15e5b0621006637981721735218f
MD5 9a9036ff3928540c77a2265955497ea4
BLAKE2b-256 1afc72359b27a53025aa2bfbf15a4f84305eab596d3e99d61e765515a0d82ed7

See more details on using hashes here.

File details

Details for the file robotframework_appium_smartlocator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_appium_smartlocator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e5c8b05c7ceb21051b61d38fe2f7ec11b4530f252781f443ea93ec9e7b4db20
MD5 acf4f844d28c9da1e8e7f17a26da4020
BLAKE2b-256 e33ca936811122cd3b83f0c93ad5cfe5a4181a30a9c5cbaff3b54d5b77e11972

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page