博客
关于我
Python UI自动化测试三方库扩展详解
阅读量:804 次
发布时间:2023-03-06

本文共 472 字,大约阅读时间需要 1 分钟。

1、读取INI配置文件

1. 配置项

在每个INI配置文件中,配置数据通常会被分组(例如“config”和“cmd”等),每个分组中可以指定对应的变量值。

示例:test.ini

# 定义config分组[config]platformName=AndroidappPackage=com.romweappActivity=com.romwe.SplashActivity# 定义cmd分组[cmd]viewPhone=adb devicesstartServer=adb start-serverstopServer=adb kill-server# 定义log分组[log]log_error=true

读取INI配置文件可以通过以下API完成:

read(filename):直接读取文件内容。

sections():获取所有分组名称,返回列表形式。

options(section):获取指定分组的所有选项名称。

items(section):获取指定分组下的所有键值对。

get(section, key):获取指定分组和键对应的值。

转载地址:http://wrafk.baihongyu.com/

你可能感兴趣的文章
python | authlib,一个强大的 Python 库!
查看>>
python | awswrangler,一个高效的 Python 库!
查看>>
python | bashplotlib,一个有趣的Python库!
查看>>
python | bentoml,一个超级厉害的 模型部署 Python 库!
查看>>
python调用jar包的模块_python调用jar包
查看>>
python | black,一个神奇的 代码格式化工具 Python 库!
查看>>
python | bleach,一个超强的 Python 库!
查看>>
python | cartopy,一个有趣的 Python 库!
查看>>
python | cloud-init,一个实用的 云计算 Python 库!
查看>>
python | code2flow,一个神奇的 Python 库!
查看>>
python | cudf,一个超实用的 Python 库!
查看>>
python | daphne,一个非常nice的 Python 库!
查看>>
python调用halcon
查看>>
python | doit,一个非常实用的 Python 库!
查看>>
python | easyocr,一个超厉害的 关于OCR的 Python 库!
查看>>
python | fastFM,一个高级的 Python 库!
查看>>
python | feature_engine,一个实用的 Python 库!
查看>>
python | filelock,一个超酷的 Python 库!
查看>>
python | fire,一个强大的 Python 库!
查看>>
python | flanker,一个神奇的 Python 库!
查看>>