Robot Framework - 如何开始使用 Appiuum 库? [英] Robot Framework - How to start with Appiuum Library?

查看:28
本文介绍了Robot Framework - 如何开始使用 Appiuum 库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

推荐答案

也许这可以给你一个良好的开端,以下是一些关键概念.

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

Appium 是什么?

Appium 像服务器一样工作,用 Nodejs 编写并实现 selenium webdriver.它允许客户端(以任何语言编写的测试用例,在您的案例中使用 Robotframework)来触发测试,并且目标应用程序(应用程序)就像一个网页.目标应用程序将响应发送回节点 js 服务器,然后节点 js 服务器将其发送回客户端.

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.

这里有一个很好的链接,可以帮助您更详细地了解 appium 的基本概念

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

您需要安装android SDK,因为它提供了许多帮助自动化的工具集,其中一个工具是adb,它会检测您的移动设备,为它们分配设备ID,您的脚本语言将引用这些工具以进行进一步通信与 appium.

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.

客户

第三点是客户端,即机器人框架.你需要先安装appium库

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

pip install robotframework-appiumlibrary

安装库后,您可以使用它向 appium 服务器发送请求.

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}

这篇关于Robot Framework - 如何开始使用 Appiuum 库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆