代码实现
参数配置表:desired_caps.yaml
platformName: Android deviceName: 192.168.175.101:5555 platformVersion: 5.1 app: C:\Users\bzART\Desktop\app-artmall-release.apk appPackage: com.baozhenart.artmall appActivity: com.baozhenart.artmall.SplashActivity noReset: True unicodeKeyboard: True resetKeyboard: True ip: 127.0.0.1 port: 4723
读取配置表:capability_yaml.py
#coding=utf-8 from appium import webdriver import yaml file=open(‘desired_caps.yaml‘,‘r‘) data=yaml.load(file) print(data) driver = webdriver.Remote(‘http://‘+str(data[‘ip‘])+‘:‘+str(data[‘port‘])+‘/wd/hub‘, data)
原文地址:https://www.cnblogs.com/shenhainixin/p/9298072.html
时间: 2024-11-14 12:24:42