1. 如python未带pip则需要安装pip:
a) cmd执行easy_install pip
2. 安装selenium(2.48.0)
a) Cmd执行pip install selenium==2.48.0
3. 安装robotframework (2.9.2)
a) Cmd执行pip install robotframework==2.9.2
4. robotframework-ride (1.5)
a) cmd执行pip install robotframework-ride==1.5
5. robotframework-selenium2library(1.7.4)
a) cmd执行pip installrobotframework-selenium2library==1.7.4
6. 安装HttpLibrary
a) cmd中执行pip install –upgrade robotframework-httplibrary
7. 安装RequestLibrary
a) cmd中执行pip install requests
b) cmd中执行pip install robotframewrok-requests
8. 安装DatabaseLibrary(连接mysql时用pyodbc可避免中文乱码)
a) cmd中执行pip install robotframework_databaselibrary
b) cmd中执行pip install pymysql
c) cmd 中执行 pip install pyodbc
d) 安装mysql-connector-odbc-5.3.6-winx64.msi
9.pymysql连接数据库
Connect To Database Using Custom Params
pymysql database='database',user='user',password='passwork',host='host',port=3306,charset='utf8'
注:charset可加可不加,用于避免从数据库中获取带中文的字符串中文不显示?,而显示实际编码如((u'\u4f60\u7684'))
10.数据库断连
disconnect from database
11.创建session
create session baidu http://www.baidu.com
12.清除session
delete all sessions