使用RF框架做mysql数据库的测试,首先要安装下面两个库:

1.pip install robotframework-databaselibrary

2.pip install PyMySQL

Robotframework-RED-mysql数据库的自动化测试

 

然后开始编写case脚本

*** Settings ***
Library DatabaseLibrary 
*** Test Cases ***
mysql
 Connect To Database Using Custom Params pymysql database='jmeter', user='root', password='123456', host='127.0.0.1', port=3306,charset='utf8'
 ${b} Query select tps from jmeter01 where time<218 
 ${c} Row Count select tps from jmeter01 where time<218
 ${d} Evaluate random.randint(0, ${c}-1) random
 log ${b[${d}][0]}
 

Robotframework-RED-mysql数据库的自动化测试

 

运行下,看结果:

Robotframework-RED-mysql数据库的自动化测试

相关文章:

  • 2021-10-28
  • 2021-04-17
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2021-06-30
  • 2021-08-07
  • 2021-11-12
猜你喜欢
  • 2021-07-15
  • 2021-05-01
  • 2021-08-19
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案