环境搭建
python3
Java JDK
.netFramework
nodejs
android SDK
appium
Appium-Python-Client(pip install Appium-Python-Client)
连接设备
cmd打开命令行窗口
输入adb connect 127.0.0.1:62001连接模拟器
输入adb shell dumpsys window windows | findstr "Current"获取当前包名
启动appium
常用元素定位
driver.find_element_by_id
driver.find_element_by_class
driver.find_element_by_name
driver.find_element_by_xpath(//*[@text=‘text属性’])
编写登录脚本
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from appium import webdriver
import unittest
import time
desired_caps = {
'platformName': 'Android',
'platfromVersion': '5.1',
'deviceName': '127.0.0.1:62001',
'appPackge': 'com.xxxx.artstation',
'appActivity': 'com.xxxx.artstati