RobotFramework环境配置十九:数据驱动(Read Column From Excel)
来源:互联网 发布:淘宝新店0销量 编辑:程序博客网 时间:2024/05/18 16:35
数据驱动
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 Column From Excel 方法
前面我们以精确地搜索课程测试为例,讨论过 Read Excel File 方法。有时,我们需要精确搜索;有时,我们也需要模糊搜索。如:搜索“畅学卡”,“全能卡”等。下面我们用 Read Column From Excel 方法实现模糊搜索。
导入自定义库文件 data_center.py
目录:F:\Robotframework\common\library
数据源
有关Excel数据源的问题,请参考个人博客数据驱动(ExcelLibrary)
用例:Case01521_eCard_Excel_SearchCards
- 登录
- 输入“畅学卡”、“全能卡”和“冲刺卡”,进行搜索
- 获取搜索到的所有卡
- 检测搜索到的卡是否包含Excel表中所有数据
封装 keyword: GUI_Search_Language & GUI_FETCH_eCards 实现搜索并获取所有卡。返回${list}记录,与读取的 Excel 数据${list_excel}比较。
需求:因为以“畅学卡”、“全能卡”和“冲刺卡”关键字来搜索,所以需要分类读取卡名。
处理:分类读取卡名(模糊搜索关心卡的类别),并去掉空卡。
源代码: Read Column From Excel
从第三行开始按列读取所有卡名;
判断数据是否为空,是空移除。
PS:关于用json处理完list,tuple和dict中乱码之后产生的问题:无法以列表,元组和字典的方式读取数据,请查看个人博客中文日志乱码问题
0 0
- RobotFramework环境配置十九:数据驱动(Read Column From Excel)
- RobotFramework环境配置十六:数据驱动(Read Data From Excel)
- RobotFramework环境配置十七:数据驱动(Read Excel File)
- RobotFramework环境配置十八:数据驱动(Read CSV File)
- RobotFramework环境配置二十:数据驱动(Get Sheet Values From Excel)
- RobotFramework环境配置二十一:数据驱动(总结)
- RobotFramework环境配置二十三:创建报告(Excel文件)
- Robotframework 写入excel数据
- RobotFramework环境配置二十四:创建报告(Excel文件)续
- Robotframework(1):配置基础环境
- robotframework 环境配置
- robotFramework 读取Excel文件数据
- RobotFrameWork(七)数据驱动之Template模板
- python+robotframework --环境安装+配置
- Read Excel files from Python
- Read date format from Excel
- RobotFramework环境配置七:多浏览器兼容性测试(1)
- RobotFramework环境配置八:多浏览器兼容性测试(2)
- Classic bluetooth chat 二
- 2016年第七届蓝桥杯C/C++程序设计本科B组省赛-快速排序
- resnet 25 训练人脸识别
- ubuntu免密ssh登录
- GIT tips
- RobotFramework环境配置十九:数据驱动(Read Column From Excel)
- .xls+.xlsx转.xml
- ASP.NET程序员常用的85个工具
- LSTM-tensorflow资料汇总
- vijos刷题记录(可能弃坑
- linux chattr 用法示例 修改文件属性
- 编程总结(二)C++11中的多线程
- input标签type="file"的格式要求,以及文件阅读,图片上传前的显示
- Spring Redis(2)数据访问