Appium-desktop的安装与使用

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

下载后,安装点击exe,就可以直接安装了。

Appium-desktop的安装与使用
默认显示监控的 host 和 port ,这和 Appium-Server中是一致的。
Appium-desktop的安装与使用
配置anroidSDK,和JDK的环境变量。

Appium-desktop的安装与使用
点击这个按钮就可以直接运行了。

Appium-desktop的安装与使用
现在连接上你的真机,或打开模拟器,编写 Appium 自动化测试脚本,可以通过Appium-desktop 来运行测试了。

这里赠送一个简单的脚本

#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()