组织架构:

  包括配置文件,反射、文件路径、Excel操作、测试报告生成

                        python接口自动化1

case.config

[MODE]
file_name=case_data.xlsx
mode={"register":'all',"login":'all',"recharge":'all'}

tools文件夹里的东西

do_config.py
 1 # -*- conding:utr-8 -*-
 2 #@Time  :2018/11/17 11:21
 3 #@Author:GYP测试
 4 #@File  :do_config.py
 5 
 6 import configparser
 7 class ReadConfig:
 8     def read_config(self,file_name,section,option):
 9         cf=configparser.ConfigParser()
10         cf.read(file_name,encoding='utf-8')
11         return cf.get(section,option)
12 if __name__ == '__main__':
13     res=ReadConfig().read_config('case.config','MODE','file_name')
14     print(res)
View Code

相关文章:

  • 2022-12-23
  • 2022-03-02
  • 2021-07-22
  • 2022-03-01
  • 2021-09-04
  • 2021-12-24
  • 2021-12-05
猜你喜欢
  • 2021-05-31
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2021-08-23
  • 2021-11-04
  • 2022-12-23
相关资源
相似解决方案