robot Farmework 运行报错解决(1)

报错内容:[ ERROR ] Calling method 'start_keyword' of listener 'C:\Python27\lib\site-packages\robotide\contrib\testrunner\TestRunnerAgent.py' failed: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)

报错原因:python在安装时,默认的编码是ascii,当程序中出现非ascii编码时,就会报些错

解决方法:

      1.在对应报错文件前面加入以下三句,比较繁琐,报错文件都要加入

import sys
reload(sys)
sys.setdefaultencoding('utf8')


      
      2.修改Python环境,比较方便,在Python的Lib\site-packages文件夹下新建一个sitecustomize.py文件,内容如下
         

#coding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')

 

你可能感兴趣的:(Robot,Framework,appium,selenium)