1)安装 Robot Framework 框架
链接:https://pan.baidu.com/s/1zyQV8by7-l9RXlEMleULTw
提取码:drsd
或者下载地址:https://pypi.org/project/robotframework/#files
pip install robotframework-3.1.2-py2.py3-none-any.whl
2)安装 robotframework-requests 库
进入robotframework-requests 文件夹
pip install --no-index --find-links=. -r requirement.txt
pip install --no-index --find-links=包目录 -r requirement.txt
certifi
chardet
idna
requests
urllib3
robotframework-requests
链接:https://pan.baidu.com/s/1zyQV8by7-l9RXlEMleULTw
提取码:drsd
3)安装 RIDE 库
进入robot-ride文件夹
pip install --no-index --find-links=. -r requirement.txt
安装顺序
six
numpy
pillow
wxPython
Pygments
Pypubsub
robotframeworklexer
pywin32
robotframework-ride
链接:https://pan.baidu.com/s/1zyQV8by7-l9RXlEMleULTw
提取码:drsd
wxPython-4.0.7.post2-cp38-cp38-win32下载地址
https://pypi.org/project/wxPython/4.0.7/#files
创建 Robot Framework 测试
打开 RIDE ,双击 python 安装目录下的 scripts ide.py 文件,闪退。
换种方式打开,在控制台输入Python ride.py 报错
<class 'robotide.preferences.configobj.UnreprError'> Parse error in value at line 67. <class 'robotide.preferences.configobj.UnreprError'> Parse error in value at line 68. <class 'robotide.preferences.configobj.UnreprError'> Parse error in value at line 69. <class 'robotide.preferences.configobj.UnreprError'> Parse error in value at line 70. <class 'robotide.preferences.configobj.UnreprError'> Parse error in value at line 71. <class 'robotide.preferences.configobj.UnreprError'> Parse error in value at line 13. libpng warning: iCCP: cHRM chunk does not match sRGB Traceback (most recent call last): File "D:pythonpythonRootlibsite-packages obotideapplicationapplication.py", line 58, in OnInit self.frame = RideFrame(self, self._controller) File "D:pythonpythonRootlibsite-packages obotideuimainframe.py", line 175, in __init__ self._init_ui() File "D:pythonpythonRootlibsite-packages obotideuimainframe.py", line 279, in _init_ui self.tree = Tree(self, self.actions, File "D:pythonpythonRootlibsite-packages obotideui ree.py", line 86, in __init__ self._images = TreeImageList() File "D:pythonpythonRootlibsite-packages obotideuiimages.py", line 42, in __init__ TestCaseController: _TreeImage(self, 'robot.png'), File "D:pythonpythonRootlibsite-packages obotideuiimages.py", line 80, in __init__ self.normal = self._get_image(image_list, normal) File "D:pythonpythonRootlibsite-packages obotideuiimages.py", line 91, in _get_image img = wx.Image(path, wx.BITMAP_TYPE_PNG).ConvertToBitmap() wx._core.wxAssertionError: C++ assertion "strcmp(setlocale(LC_ALL, NULL), "C") == 0" failed at ....srccommonintl.cpp(1579) in wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now there is a mismatch between C/C++ and Windows locale. Things are going to break, please only change locale by creating wxLocale objects to avoid this! OnInit returned false, exiting... Error in atexit._run_exitfuncs: wx._core.wxAssertionError: C++ assertion "GetEventHandler() == this" failed at ....srccommonwincmn.cpp(478) in wxWindowBase::~wxWindowBase(): any pushed event handlers must have been removed
解决方法一:
在Python安装目录下找到该文件application.py,如我的地址D:Program Files (x86)python3.8Libsite-packages obotideapplication 文件夹里
将self._inital_locale = wx.Locale(wx.LANGUAGE_ENGLISH)注释
换成:self.locale = wx.Locale(wx.LANGUAGE_CHINSES_SIMPLE)
方式二:适用于Python=3.8,robotframework-ride=1.7.4.2
robotframework-ride-1.7.4.2支持Python2.7
我的Python是3.8
于是根据官网解决方式
pip install psutil
pip install -U https://github.com/robotframework/RIDE/archive/master.zip
或者可以先下载,https://github.com/robotframework/RIDE/archive/master.zip,再进行安装
安装
进入RIDE-master的下载目录不用解压
pip install -U RIDE-master.zip
安装RIDE-master成功后,桌面会出现图标