Robot Framework学习(7):数据库自动化测试

在测试过程中经常会用到数据库,无论是测试数据还是查询呢数据,同时有时候也需要对数据库进行测试。

常见的数据库有Oracle、MySQL、sqlite3

每个数据库都需要有相应的连接方法,DatebaseLibrary能够兼容多种数据库。

1. 安装DatebaseLibrary和cx_Oracle

暂时还没有试过

2. DatebaseLibrary关键字

connect to database  连接数据库,标准连接

connect to database using custom params  使用自定义参数连接数据库

diconnect from database  断开数据库

query  查询,可以用List接收返回结果

row count  查询sql语句的结果条数

execute sql script  执行sql文件

execute sql string  执行sql脚本

猜你喜欢

转载自blog.csdn.net/u013783095/article/details/81270941