机器人框架-如何从Appiuum库开始?

0 robotframework appium

我正在尝试使用Robot Framework中的AppiumLibrary自动化Mobile应用程序。有人可以帮助我如何开始在机器人框架中安装Appium库吗?

pan*_*hra 6

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
Run Code Online (Sandbox Code Playgroud)

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}
Run Code Online (Sandbox Code Playgroud)