Appium-desktop安装与使用

Appium-desktop安装与使用

Appium-desktop是什么?

项目描述:

Appium Server and Inspector in Desktop GUIs for Mac, Windows, and Linux。

Appium移动测试中有个很重新的组件Appium-Server,它主要用来监听我们的移动设备(真机或模拟器),然后将不同编程语言编写的 appium 测试脚本进行解析,然后,驱动移动设备来运行测试。

Appium-Server下载地址:https://bitbucket.org/appium/appium.app/downloads/

但Appium-Server有一两年没有更新了。Windows版在2015年底止步于的 AppiumForWindows_1_4_16_1.zip 

于是,新的工具 Appium-desktop 来了! 它来继续 Appium-Server的使命,当然, Appium-Server当前仍然是可用的。

 

 

下载与安装:

Appium-desktop项目地址:https://github.com/appium/appium-desktop

下载地址:https://github.com/appium/appium-desktop/releases

根据自己的平台选择相关的包进行下载。本文以Windows为例,所以选择 appium-desktop-Setup-1.2.4.exe 文件进行下载。

安装过程太简单了,双击 exe 文件,然后,等待安装完就好了,中间都不需要你设置任何选项。所以,这里就不贴图了。

 

运行与使用:

安装完成桌面会生成一个紫色的appium 图标,双击打开。

默认显示监控的 host 和 port ,这和 Appium-Server中是一致的。点击 “Start Server V 1.7.1” 按钮启动服务。

 

现在启动 启动你的移动设备(真机或模拟器),编写 Appium 自动化测试脚本,可以通过Appium-desktop 来运行测试了。

 

 

以下为Python + Appium-Python-Client库所编写的测试脚本。

复制代码
#coding=utf-8
from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['deviceName'] = 'Android Emulator'
desired_caps['appPackage'] = 'com.android.calculator2'
desired_caps['appActivity'] = '.Calculator'

driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

driver.find_element_by_name("1").click()
driver.find_element_by_name("5").click()
driver.find_element_by_name("9").click()
driver.find_element_by_name("delete").click()
driver.find_element_by_name("9").click()
driver.find_element_by_name("5").click()
driver.find_element_by_name("+").click()
driver.find_element_by_name("6").click()
driver.find_element_by_name("=").click()

driver.quit()
复制代码

 

运行效果如上图右半部分。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值