Skip to main content

Robot Framework Mobile app testing library for Appium Client Android & iOS & Web

Project description

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)

Latest PyPI version Number of PyPI downloads <nav class="contents" id="contents">

Contents

</nav>

Keyword Documentation

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

Installation

The recommended installation method is using pip:

pip install --upgrade robotframework-appiumlibrary

See Robot Framework installation instructions for detailed information about installing Python and Robot Framework itself.

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.

Usage

To write tests with Robot Framework and AppiumLibrary, AppiumLibrary must be imported into your RF test suite. See Robot Framework User Guide for more information.

As it uses Appium make sure your Appium server is up and running. For how to use Appium please refer to Appium Documentation

When using Robot Framework, it is generally recommended to write tests easy to read/modify. The keywords provided in AppiumLibrary are pretty low level. It is thus typically a good idea to write tests using Robot Framework’s higher level keywords that utilize AppiumLibrary keywords internally. This is illustrated by the following example where AppiumLibrary keywords like Input Text are primarily used by higher level keywords like Input Search Query.

*** Settings ***
Documentation  <s>Simple example using AppiumLibrary</s>
Library  AppiumLibrary

*** Variables ***
${ANDROID_AUTOMATION_NAME}    <s>UIAutomator2</s>
${ANDROID_APP}                ${CURDIR}<s>/demoapp/ApiDemos-debug.apk</s>
${ANDROID_PLATFORM_NAME}      <s>Android</s>
${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  <s>Hello World!</s>
  Submit Search
  Search Query Should Be Matching  <s>Hello World!</s>


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

Input Search Query
  [Arguments]  ${query}
  Input Text  <s>txt_query_prefill</s>  ${query}

Submit Search
  Click Element  <s>btn_start_search</s>

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

Create a file with the content above (name it: test_file.robot) and execute:

robot test_file.robot

The above example is single file test case, more examples can be found in a sample project that illustrates using Robot Framework and AppiumLibrary. Check the sample project that you can find examples of mobile web & ios & android.

Contributing

Fork the project, make a change, and send a pull request!

Project Contributors

AppiumLibrary is modeled after (and forked from) appiumandroidlibrary, but re-implemented to use appium 1.X technologies.

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-appiumlibrary-1.6.3.tar.gz (29.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page