RobotFramework环境配置十八:数据驱动(Read CSV File)
来源:互联网 发布:苹果电脑炒股软件 编辑:程序博客网 时间:2024/05/17 04:53
数据驱动
RIDE提供的库:
- Create List
- Get File
- Import Variables
- Template
- ExcelLibrary
自定义库:DataCenter.py
- Read Data From Excel
- Read Excel File
- Read CSV File
- Read Column From Excel
- Get Sheet Values From Excel
一、数据驱动测试注重于测试软件的功能性需求,也即数据驱动测试执行程序所有功能需求的输入条件。实现KISS。
二、Read CSV File 方法
以选卡中心选择课程测试为例讨论 Read CSV File 方法。
导入自定义库文件 data_center.py
目录:F:\Robotframework\common\library
用例:Case0128_eCard_Details_Display
- 登陆选卡中心
- 选卡
- 检测是否正确显示畅学卡信息
需求:
A. 因为“单张畅学卡”由4项随机组合而成,所以需要排列组合成唯一一张卡
B. 读取每张卡的信息,检测是否正确显示畅学卡信息
处理:
A. 以字典的方式读取组合
B. 以字典的方式赋值组合给keyword: GUI_SELECT_eCard
Keyword: GUI_SELECT_eCard
由传入的4个参数点击,确定唯一卡。
数据源:
A. 畅学卡信息
B. 选卡组合
源代码: Read Excel File
PS:
1. 关于处理Excel整数变浮点数的问题:python读取Excel文件后,如何处理浮点数的问题请查看个人博客数据驱动(ExcelLibrary)
2. 关于用json处理完list,tuple和dict中乱码之后产生的问题:无法以列表,元组和字典的方式读取数据,请查看个人博客中文日志乱码问题
0 0
- RobotFramework环境配置十八:数据驱动(Read CSV File)
- RobotFramework环境配置十七:数据驱动(Read Excel File)
- RobotFramework环境配置十六:数据驱动(Read Data From Excel)
- RobotFramework环境配置十九:数据驱动(Read Column From Excel)
- RobotFramework环境配置二十一:数据驱动(总结)
- RobotFramework环境配置二十二:创建报告(CSV文件)
- RobotFramework环境配置二十:数据驱动(Get Sheet Values From Excel)
- read csv file. TextFieldParser
- Robotframework(1):配置基础环境
- robotframework 环境配置
- python read file(f,csv)
- Java read and write csv file(注意事项)
- RobotFrameWork(七)数据驱动之Template模板
- python+robotframework --环境安装+配置
- C# read excel and CSV file
- python.pandas read and write CSV file
- selenium 数据驱动 (基于TestNG CSV)
- RobotFramework环境配置七:多浏览器兼容性测试(1)
- runtime交换方法的正确姿势
- 什么是Java异常?
- windows下C++的中文块注释问题
- PHP 腾讯云 配置 Apache + PHP
- WebView中文本输入框,点击弹出输入框后,崩溃
- RobotFramework环境配置十八:数据驱动(Read CSV File)
- bzoj 1251 序列终结者
- QTcpSocket 及 TCP粘包分析
- Windows多媒体定时器(精确到1ms)
- 图 基本概念和性质
- JSP三种页面跳转方式的比较
- C#中使用MATLAB
- 网络寻路(dfs或者枚举)
- linux自旋锁——读写锁