配置:windowns10 64位,Python3.6.0
安装RF所需库:
pip install robotframework==3.1.1
pip install Pypubsub==3.3.0
pip install --user -U wxpython==4.0.3
pip install robotframework-ride==1.7.3.1
pip install robotframework-selenium2library
安装完毕之后报如下错误:
C:Usersxyg>ride.py
Traceback (most recent call last):
File "c:usersxygappdatalocalprogramspythonpython36libsite-packages
obotideapplicationapplication.py", line 65, in OnInit
self._find_robot_installation()
File "c:usersxygappdatalocalprogramspythonpython36libsite-packages
obotideapplicationapplication.py", line 124, in _find_robot_installation
str(os.path.dirname(rf_file), 'utf-8'))).publish()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 11: invalid continuation byte
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
参考https://www.cnblogs.com/dream66/p/10647166.html进行字体修改,发现还是未能解决,于是又回到str(os.path.dirname(rf_file), 'utf-8'))).publish() 这行进行定位,发现是编码问题
找到这个路径c:usersxygappdatalocalprogramspythonpython36libsite-packages obotideapplicationapplication.py(每个人安装Python目录不一样可能会有所不同,默认是这个目录,也可以在cmd执行Python--import sys--sys.path找到自己的Python安装路径)
1.找Python路径
2.找到application.py文件
3,修改编码格式,大概在第124行处
然后保存,重新在cmd下执行ride.py,成功启动RF框架