Skip to main content

Appium Library

Introduction

AppiumLibrary is an appium testing library for Robot Framework. Library can be downloaded from PyPI.
It uses Appium to communicate with Android and iOS application similar to how Selenium WebDriver talks to web browser.
It is supporting Python 3.7+ (since Appium Python Client doesn't support Python 2.7 anymore)

Tutorial Videos about RF and Appium

Link to Playlist: https://youtube.com/playlist?list=PL4GZKvvcjS3vAPWLqWbKZogkL5cD71yrT

Keyword Documentation

See Keyword Documentation for available keywords and more information about the library in general.

Installation

Install with pip:

pip install robotframework-appiumlibrary

Device Setup

After installing the library, you still need to setup an simulator/emulator or real device to use in tests. iOS and Android have separate paths to follow, and those steps better explained in Appium Driver Setup Guide. Please follow the Driver-Specific Setup according to platform.

Example

*** Settings ***
Documentation Simple example using AppiumLibrary
Library AppiumLibrary

*** Variables ***
${ANDROID_AUTOMATION_NAME} UIAutomator2
${ANDROID_APP} ${CURDIR}/demoapp/ApiDemos-debug.apk
${ANDROID_PLATFORM_NAME} Android
${ANDROID_PLATFORM_VERSION} %{ANDROID_PLATFORM_VERSION=11}

*** Test Cases ***
Should send keys to search box and then check the value
Open Test Application
Input Search Query Hello World!
Submit Search
Search Query Should Be Matching Hello World!


*** Keywords ***
Open Test Application
Open Application http://127.0.0.1:4723/wd/hub automationName=${ANDROID_AUTOMATION_NAME}
... platformName=${ANDROID_PLATFORM_NAME} platformVersion=${ANDROID_PLATFORM_VERSION}
... app=${ANDROID_APP} appPackage=io.appium.android.apis appActivity=.app.SearchInvoke

Input Search Query
[Arguments] ${query}
Input Text txt_query_prefill ${query}

Submit Search
Click Element btn_start_search

Search Query Should Be Matching
[Arguments] ${text}
Wait Until Page Contains Element android:id/search_src_text
Element Text Should Be android:id/search_src_text ${text}