安装python
添加环境变量:C:\Python27;C:\Python27\Scripts
安装pip
pip> python setup.py install
安装ssh依赖包
robotframework-sshlibrary-2.1.1> python setup.py install
安装request依赖包
pip install requests
安装robot
cmd> pip install robotframework
安装robot的IDE
pycharm-community-4.5.1.exe
安装RIDE的依赖包
(Wxpython 是python 非常有名的一个GUI库,因为RIDE 是基于这个库开发的,所以这个必须安装。):
wxPython2.8-win32-unicode-2.8.12.1-py27.exe
安装RIDE:RIDE-master
(RIDE就是一个图形界面的用于创建、组织、运行测试的软件。)
robotframework-ride-1.3.win32.exe
如果不是通过EXE安装的
可创建快捷方式:D:\python\python.exe -c "from robotide import main;main()"
使用icon指向D:\python\Lib\site-packages\robotide\widgets\robot.ico
安装sublime3及其插件
解压后改名为Robot Framework Assistant,放在D:\Program Files (x86)\Sublime Text 3\Data\Packages下即可
安装python对windows的扩展
pywin32-218.win32-py2.7.exe
可能无法找到python.exe,那么你可能用到如下REG:
============================================================
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Python]
[HKEY_CURRENT_USER\Software\Python\Pythoncore]
[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.7]
[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.7\InstallPath]
@="C:\\Python27"
[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.7\PythonPath]
@="C:\\Python27;C:\\Python27\\Lib\\;C:\\Python27\\DLLs\\"
============================================================
安装Pillow
以便使用ScreenshotLibrary,下载地址:https://pypi.python.org/pypi/Pillow
Pillow-3.1.1.win32-py2.7.exe
安装AutoItLibrary(win7 x32):
AutoItLibrary-1.1_x32.zip
python setup.py install
然后使用RIDE打开Calculator_Test_Cases.html就可以了
自动引入库
修改%APPDATA%\RobotFramework\ride中的settings.cfg文件中的
# Auto imports is a list of libraries whose keywords are always visible in keyword completion.
# If the library needs arguments, they follow the library name with '|' as a separator.
# Example: auto imports = ['MyLib', 'AnotherLibraryWithArgs|arg1|arg2']
auto imports = []
设置库路径
库的引入前,需要设置PYTHONPATH,这样才能引入成功,resource文件相同。
- PYTHONPATH=c:\robot\libs
- PYTHONPATH=/opt/robot/libs ride.py,先设路径再启动
- 修改settings.cfg文件
# Locations to add into PYTHONPATH. Non-absolute paths are considered relative
# to the directory where RIDE starts. Backslashes must be escaped by doubling
# them (\\). Alternatively it is possible to use forward slash (/) as the path
# separator regardless the operating systems.
# Example: pythonpath = ['c:/robot/testlibs', 'd:/project/resources']
pythonpath = []
在pycharm中安装支持插件
在插件中点击:Browse reponsitories并输入intellibot
安装并重启即可。
点击File>setting>editor>file types,选择右侧的Robot Feature后,可在正文新增对.txt文件的支持。
如果想在pycharm中执行rf用例
- 点击File>setting>Tools>External tools,新增一个RobotRun Testsuite和RobotRun SingleCase。
- -d results $FileName$
- -d results -t "$SelectedText$" ./
- -d results $FileName$
- 右键执行