Robot Framework启动ride.py失败的解决方法

文章目录

  • 1、问题描述
  • 2、问题处理


1、问题描述

  • ride.py启动失败,提示信息如下
    Robot Framework启动ride.py失败的解决方法_第1张图片
  • 各版本安装包如下
    Robot Framework启动ride.py失败的解决方法_第2张图片

2、问题处理

  • 找到D:\Program Files\Python3.7.1_x64\Lib\site-packages\robotide\contrib\testrunner\testrunnerplugin.py

Robot Framework启动ride.py失败的解决方法_第3张图片

  • 修改以下代码
  • 下面是修改前的代码
    def _create_font(self):
        font=wx.SystemSettings.GetFont(wx.SYS_ANSI_FIXED_FONT)
        if not font.IsFixedWidth():
            # fixed width fonts are typically a little bigger than their
            # variable width peers so subtract one from the point size.
            font = wx.Font(font.GetPointSize()-1, wx.FONTFAMILY_MODERN,
                           wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
        return font
  • 修改后代码如下
    def _create_font(self):
        #font= wx.SystemSettings.GetFont(wx.SYS_ANSI_FIXED_FONT) #这是默认的,会报错
        #set a number in [0-8,10,13],then run ride successfully,SYS_SYSTEM_FONT=13,represents system font
        #在[0-8,10,13]中设置一个数字,然后成功运行ride,SYS_SYSTEM_FONT=13,表示系统字体
        font = wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT)
        if not font.IsFixedWidth():
            # fixed width fonts are typically a little bigger than their
            # variable width peers so subtract one from the point size.
            font = wx.Font(font.GetPointSize()-1, wx.FONTFAMILY_MODERN,
                           wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
        return font

Robot Framework启动ride.py失败的解决方法_第4张图片

你可能感兴趣的:(Robot,Framework,踩过的坑)