Appium使用

2019-12-25  本文已影响0人  zolobdz

安装

https://www.jianshu.com/p/eec62494a5b0

使用前注意

  1. 编译打包到终端;
    注:2〜4不会要可以找IOS开发人员帮助,本宝宝也是找开发解决的。
    5.工程中终端配置启动项

python脚本使用Tips

from appium import webdriver
import pandas as pd
import time
desired_caps = {
    'deviceName': 'iPhone X', #模拟器名称
    'platformName': 'ios',
    'platformVersion': '11.2', #模拟器版本号,不是app的最低版本号
    'bundleId': 'com.galaxyentertainment.crmmobile'
}
# 真机需要一下这些
# desired_caps['bundleId'] = 'com.galaxyentertainment.crmmobile'     
# desired_caps['udid'] = 'f37a8a5e786b4ee728961a118591f43d50baa08d'
# desired_caps['xcodeOrgId'] = "填写你公司的开发者帐号"
# desired_caps['xcodeSigningId'] = "iPhone Developer"
# desired_caps['no-reset'] = True
# desired_caps['app'] = "/Users/woody/Downloads/DriverSide.ipa"
driver = webdriver.Remote(command_executor="http://127.0.0.1:4723/wd/hub", desired_capabilities=desired_caps)
脚本运行成功自动弹出页面.png
# 获取ui控件(根据type)
# 设置用户名+密码
tfs = driver.find_element_by_class_name('TextField')

# 清空输入框,注意模拟器需要打开键盘弹出功能(cmd+k)
tfs.clear()
tfs.send_keys('ptr.wei.zou')

passwordTF = driver.find_element_by_class_name('XCUIElementTypeSecureTextField')
passwordTF.clear()
passwordTF.send_keys('Abcd12346!@#')

# 登录
driver.find_element_by_name('Login').click()
上一篇 下一篇

猜你喜欢

热点阅读