3
votes

I define a function in the custom library in Robot Framework:

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

but when I search the function in RIDE, the comment for the function shows as below:

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

The Chinese shows in unicode, does anyone know why this happen? enter image description here

1

1 Answers

2
votes

Declare this in your custom library header

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

Mostly looks like

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


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

will result this