目录
手机操作API
1、获取手机分辨率
driver.get_window_size()
返回值:
字典类型
有两个key,分别是width和height
宽和高的值是int类型
2、手机截图
参数:
filename:指定路径下,指定格式的图片
driver.get_screenshot_as_file(filename)
代码:
from appium import webdriver
import time
desired_caps = dict()
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '5.1'
desired_caps['deviceName'] = '192.168.56.101:5555'
desired_caps['appPackage'] = 'com.android.settings'
desired_caps['appActivity'] = '.Settings'
driver = webdriv