Chinese comments cannot display correctly in RIDE in Robot Framework

I am defining a function in a custom library in Robot Framework:

def close_browser(self):
    '''
    description: 关闭当前浏览器
    params:
        None
    return:
        None
    '''
    self.driver.quit()

      

but when I search for a function in RIDE, the comment for the function is displayed below:

description: \ xb9 \ xd8 \ xb1 \ xd5 \ xb5 \ xb1 \ xc7 \ xb0 \ xe4 \ xaf \ xc0 \ xc0 \ xc6 \ xf7 params: No return: None

Chinese shows in unicode, does anyone know why this is happening? enter image description here

+3


source to share


1 answer


Declare this in your own library header

# -*- coding: utf-8 -*-

      

Basically looks



# -*- coding: utf-8 -*-


class aaMyLibrary:
    def stackover(self):
        '''
        description: 关闭当前浏览器
        params:
            None
        return:
            None'''
        self.driver.quit()

      

will result in this

+2


source







All Articles