CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-appium-python-client

Python client library for Appium mobile automation framework extending Selenium WebDriver with iOS and Android testing capabilities

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

Appium Python Client

A comprehensive Python client library for Appium, the open-source mobile automation framework. The Appium Python Client extends Selenium WebDriver with mobile-specific functionality for iOS and Android app testing, providing a unified API for mobile automation across platforms.

Package Information

  • Package Name: Appium-Python-Client
  • Language: Python 3.9+
  • Installation: pip install Appium-Python-Client
  • Version: 5.2.2
  • Dependencies: selenium>=4.26,<5.0, typing-extensions~=4.13
  • Appium Server: Compatible with Appium 2.x (recommended 2.0+)
  • WebDriver Protocol: Supports W3C WebDriver standard

Core Imports

from appium import webdriver
from appium.webdriver.common.appiumby import AppiumBy
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions

For specific platform options:

# Android options
from appium.options.android.uiautomator2 import UiAutomator2Options
from appium.options.android.espresso import EspressoOptions

# iOS options
from appium.options.ios.xcuitest import XCUITestOptions
from appium.options.ios.safari import SafariOptions

# Other platforms
from appium.options.mac.mac2 import Mac2Options
from appium.options.windows.windows import WindowsOptions

Basic Usage

from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.webdriver.common.appiumby import AppiumBy

# Configure Android options
options = UiAutomator2Options()
options.platform_name = "Android"
options.device_name = "Android Emulator"
options.app = "/path/to/your/app.apk"

# Start WebDriver session
driver = webdriver.Remote("http://localhost:4723", options=options)

# Find and interact with elements
element = driver.find_element(AppiumBy.ACCESSIBILITY_ID, "button1")
element.click()

# Use mobile-specific locators
android_element = driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR, 
                                    'new UiSelector().text("Login")')

# Clean up
driver.quit()

Architecture

The Appium Python Client follows a modular extension-based architecture:

  • WebDriver: Core class extending Selenium's Remote WebDriver with Appium-specific capabilities
  • Extensions: Mixin classes providing specialized functionality (applications, keyboard, context, etc.)
  • Options Classes: Platform-specific capability configuration (Android, iOS, Windows, Mac)
  • Locators: Mobile-specific element finding strategies via AppiumBy
  • Service Management: Appium server lifecycle management
  • Platform Support: Cross-platform testing with unified API

This design enables comprehensive mobile testing capabilities while maintaining compatibility with existing Selenium-based test frameworks.

Capabilities

WebDriver and Session Management

Core WebDriver functionality including session creation, element interaction, and mobile WebElement extensions. Provides the foundation for all mobile automation operations.

class WebDriver:
    def __init__(self, command_executor: str, extensions: list = None, 
                 options = None, client_config = None): ...
    def start_session(self, capabilities: dict, browser_profile = None): ...
    def get_status(self) -> dict: ...
    def create_web_element(self, element_id: str): ...

WebDriver Core

Mobile Element Location

Appium-specific locator strategies for finding mobile elements across iOS and Android platforms, extending beyond standard WebDriver locators.

class AppiumBy:
    ACCESSIBILITY_ID: str = "accessibility id"
    ANDROID_UIAUTOMATOR: str = "-android uiautomator"
    IOS_PREDICATE: str = "-ios predicate string"
    IOS_CLASS_CHAIN: str = "-ios class chain"
    IMAGE: str = "-image"
    FLUTTER_INTEGRATION_SEMANTICS_LABEL: str = "-flutter semantics label"

Element Location

Application Management

Application lifecycle management including installation, background/foreground control, and state querying across mobile platforms.

def background_app(self, seconds: int): ...
def is_app_installed(self, bundle_id: str) -> bool: ...
def install_app(self, app_path: str, **options): ...
def remove_app(self, app_id: str, **options): ...
def terminate_app(self, app_id: str, **options): ...
def activate_app(self, app_id: str): ...
def query_app_state(self, app_id: str) -> int: ...

Application Management

Device Interaction

Hardware-level device interactions including keyboard, device rotation, location services, and hardware actions like shake and lock.

def hide_keyboard(self, key_name: str = None, key = None, strategy: str = None): ...
def is_keyboard_shown(self) -> bool: ...
def shake(self): ...
def lock(self, seconds: int = None): ...
def unlock(self): ...
def is_locked(self) -> bool: ...
def set_location(self, latitude: float, longitude: float, altitude: float = None): ...

Device Interaction

Android Platform

Android-specific capabilities including network management, activity control, SMS simulation, GSM operations, and power management.

def start_activity(self, app_package: str, app_activity: str, **opts): ...
def current_activity(self) -> str: ...
def set_network_connection(self, connection_type: int): ...
def toggle_wifi(self): ...
def send_sms(self, phone_number: str, message: str): ...
def set_gsm_call(self, phone_number: str, action: str): ...
def set_power_capacity(self, percent: int): ...

Android Platform

Configuration and Options

Platform-specific capability configuration classes for Android (UiAutomator2, Espresso), iOS (XCUITest, Safari), and other platforms.

class UiAutomator2Options(AppiumOptions):
    def set_capability(self, name: str, value): ...
    def get_capability(self, name: str): ...
    def to_capabilities(self) -> dict: ...

class XCUITestOptions(AppiumOptions):
    def set_capability(self, name: str, value): ...
    def get_capability(self, name: str): ...
    def to_capabilities(self) -> dict: ...

Configuration Options

Service Management

Appium server lifecycle management including startup, shutdown, and connectivity validation for local and remote testing scenarios.

class AppiumService:
    def start(self, **kwargs): ...
    def stop(self, timeout: int = None): ...
    @property
    def is_running(self) -> bool: ...
    @property
    def is_listening(self) -> bool: ...

def find_executable(executable: str) -> str: ...
def get_node() -> str: ...

Service Management

Advanced Features

Advanced capabilities including context switching, screen recording, image comparison, clipboard operations, and Flutter integration.

@property
def contexts(self) -> list: ...
@property
def current_context(self) -> str: ...
def start_recording_screen(self, **options): ...
def stop_recording_screen(self) -> str: ...
def compare_images(self, base64_image1: str, base64_image2: str, **options): ...
def get_clipboard(self, content_type = None): ...
def set_clipboard(self, content: str, content_type = None): ...

Advanced Features

Install with Tessl CLI

npx tessl i tessl/pypi-appium-python-client
Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/appium-python-client@5.2.x
Publish Source
CLI
Badge
tessl/pypi-appium-python-client badge