Robot Framework:环境安装
Windows Python2.7
前置条件:安装python2.7,下载地址:https://www.python.org/downloads/
安装wxPython
pip install wxPython
注意版本要对应python版本,否则运行python ride.py时会提示:
wxPython not found. You need to install wxPython 2.8.12.1 with unicode support to run RIDE. wxPython 2.8.12.1 can be downloaded from http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/
选择Unicode版本,不然安装后不能支持中文。下载地址: http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/
安装robotframework
pip install robotframework
安装robotframework-ride
pip install robotframework-ride
安装selenium2library(web自动化测试关键字)
pip install robotframework-selenium2library
MacOs
安装robotframework3.0
下载:https://pypi.org/project/robotframework/#files,解压文件,终端进入目录,然后执行命令安装
python3 setup.py install
安装wxPython
在https://sourceforge.net/projects/wxpython/files/wxPython/下载2.8.13或者3.0.2版本
参考:https://blog.csdn.net/qq_23114525/article/details/81509917,其中第七步未执行
安装robotramework-ride
下载:https://pypi.org/project/robotframework-ride/,解压文件,终端进入目录,执行命令安装
sudo easy_install robotframework-ride
安装selenium2library
除了上面直接用pip的方式,还可以在https://pypi.python.org/pypi/robotframework-selenium2library/1.5.0下载文件,解压文件,终端进入目录,执行命令手动安装。
sudo easy_install robotframework-selenium2library
运行ride
直接在终端中,输入ride.py
问 题
mac在运行用例时,遇到报错
Robot Framework installation not found. To run tets, you need to install Robot Framework separately. See http://robotframework.org for installation instructions.
可能是版本问题,之前是安装的3.1版本,重新安装3.0版本后,问题解决。
sudo pip uninstall robotframework
pip install robotframework==3.0