Code Monkey home page Code Monkey logo

robotframework-appiumlibrary's Introduction

Appium library for RobotFramework

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

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

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.

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.

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  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}

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.

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

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

robotframework-appiumlibrary's People

Contributors

jollychang avatar serhatbolsu avatar yahman72 avatar frankbp avatar joshuariveramnltech avatar akupahkala avatar soukingang avatar erik1510 avatar minhnguyenphuonghoang avatar lucyking avatar kshrestha99 avatar babarpramod avatar smaspe avatar leongxf avatar lannyzhujin avatar extr3mal avatar ulhasdeshmukh avatar tbrito-daitan avatar idxn avatar jvilla17 avatar meallia avatar jennyw1 avatar jmcn avatar erolstt avatar ac-simoes avatar tvdberk avatar howtoautomateinth avatar ano4r avatar scenk avatar robco avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.