时间:2021-07-01 10:21:17 帮助过:28人阅读
Connect To Database pymysql study root 123456 192.168.1.110 3306 #连接study数据库 Execute Sql Script C:/Users/Administrator/Desktop/sql.txt #通过脚本文件进行执行sql(注意转义) Execute Sql String INSERT INTO student(name,age,class)VALUES("qian",23,3),("sun",20,1) #执行sql语句
Connect To Database pymysql study root 123456 192.168.1.110 3306 #连接study数据库 @{result} Query select * from student where name = "lisi" #查询数据且返回查询结果 Log Many ${result} #结果如下 20200312 15:20:10.798 : INFO : [(2, ‘lisi‘, 19, ‘3‘)]
Connect To Database pymysql study root 123456 192.168.1.110 3306 #连接study数据库 ${count} Row Count select * from student #返回查询结果的总行数 log ${count}
Connect To Database pymysql study root 123456 192.168.1.110 3306 #连接study数据库 Row Count Is 0 select * from student where name = "lisi" #判断查询结果为 0 行数据,如果结果为 0 行数据则 pass,否则fail
Connect To Database pymysql study root 123456 192.168.1.110 3306 #连接study数据库 Row Count Is Equal To X select * from student where name = "lisi" 1 #判断查询结果数据为1行 Row Count Is Greater Than X select * from student where class = "2" 1 #判断查询结果数据大于1行 Row Count Is Less Than X select * from student where class = "2" 3 #判断查询结果数据小于3行
RF(数据库测试)
标签:mini database mamicode api info work 注意 res exec