1、安装databaselibrary、pymysql
通过cmd命令执行:pip install robotframework-databaselibrary
通过cmd命令执行:pip install robotframework-databaselibrary
2、导入库到robotframework中
编辑以下代码:
Connect To Database Using Custom Params | pymysql | database='数据名称', user='用户名', password='密码', host='IP地址', port=3306 | #mysql数据库默认端口是:3306 |
${data} | query | select * from sys_user where name='xiaoming' | #SQL语句 |
log | ${data} |
---END---