Robot Framework - How to start with Appiuum Librar

2019-06-12 21:01发布

I am trying automate Mobile application using AppiumLibrary in Robot Framework. Can anybody help me how to start with installing the Appium library in robot framework?

2条回答
Evening l夕情丶
2楼-- · 2019-06-12 21:24

Run the following command in cmd after installing robotframework-appiumlibrary:

pip install --upgrade robotframework-appiumlibrary

It solved the same issue which I experienced.

查看更多
成全新的幸福
3楼-- · 2019-06-12 21:39

May be this can give you a head start, below are some key concepts to start with.

What is Appium ?

Appium works like a server, written in Nodejs and implements selenium webdriver . it allows the client (test cases written in any language, Robotframework in your case ) to fire the tests and the target application ( Apps) acts like a web page . Target application sends back the response to node js server which in turn send it back to client.

here is an excellent link which can help you to understand the basic concept of appium in more details

https://automationlab0000.wordpress.com/2018/09/10/appium/

Android SDK

You need to install android SDK as it provides many set of tools to help in automation, one such tool is adb, it detect your mobile devices, assign device id to them, which will be referenced by your scripting language for further communication with appium.

Client

Third point is client i.e. Robot Framework. You need to install appium library first

pip install robotframework-appiumlibrary

once you have library installed you can use it to send request to appium server.

here is a sample programe to open dialer in phone

*** Settings ***
Documentation    This script starts apps on two phones
Library           AppiumLibrary
Library          Collections

*** Variables ***
${APPIUM_SERVER1}    http://0.0.0.0:4723/wd/hub



*** Test cases ***
Test
    setup and open android phone1


*** Keywords ***
setup and open android phone1
    ${androiddriver1}=    Open Application    ${APPIUM_SERVER1}    platformName=android    platformVersion=7.0    deviceName=f1232233    automationName=uiautomator2
    ...    appPackage=com.samsung.android.contacts    newCommandTimeout=2500    appActivity=com.android.dialer.DialtactsActivity
    Set Suite Variable    ${androiddriver1}
查看更多
登录 后发表回答