from appium import webdriver
import time
import yaml
from config.appiumServer import AppiumServer
import os
class GetDesiredCaps():
def getDesiredCaps(self,deviceName):
configInfo = open('D:\project\Test\config\deviceConfig.yaml','r').read()
configYaml = yaml.load(configInfo)
appServer = AppiumServer()
for device in configYaml:
if deviceName in device['desc']:
print(device)
appServer.startAppium("127.0.0.1",device['port'],deviceName)
return device["desired_caps"],device['port']
if __name__=="__main__":
ss = GetDesiredCaps()
print(ss.getDesiredCaps("test1"))
getDesiredCaps
最新推荐文章于 2023-03-31 20:44:22 发布
本文介绍了一种使用Python和Appium进行移动应用自动化测试的方法。通过读取设备配置文件,启动Appium服务器,并获取特定设备的desired_caps参数,实现自动化测试的高效配置。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Python3.11
Conda
Python
Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本
4062

被折叠的 条评论
为什么被折叠?



