#coding=utf-8
from appium import webdriver
desired_caps={}
desired_caps["platformName"]="Android"
desired_caps["platformVersion"]="4.2.2"
desired_caps["deviceName"]="192.168.245.101:5555"
desired_caps["appPackage"]="com.android.calculator2"
desired_caps["appActivity"]=".Calculator"
dr=webdriver.Remote("http://127.0.0.1:4723/wd/hub",desired_caps)
dr.find_element_by_name("1").click()
dr.find_element_by_name("5").click()
dr.find_element_by_name("9").click()
dr.find_element_by_name(u"删除").click()
dr.find_element_by_name("9").click()
dr.find_element_by_name("5").click()
dr.find_element_by_name("+").click()
dr.find_element_by_name("6").click()
dr.find_element_by_name("=").click()
dr.quit()
adb devices 查看连接设备名字
adb及SDK的环境变量配置正确