美文网首页
创建RF测试库之普通的python函数

创建RF测试库之普通的python函数

作者: Riclue | 来源:发表于2018-07-26 17:47 被阅读10次

新建一个testLibrary的文件放在文件夹下

import hashlib

def md5_py(str):
    '''
    生成MD5
    :return:
    '''
    m = hashlib.md5()
    m.update(str.encode("utf8"))
    print(m.hexdigest())
    return m.hexdigest()

我们用robot这样用

Documentation    Suite description
Library   testLibrary.py
*** Test Cases ***
MD5_1_1
    set test variable    ${string}    'liuchang'
    ${md5_string}     md5_py    ${string}

相关文章

网友评论

      本文标题:创建RF测试库之普通的python函数

      本文链接:https://www.haomeiwen.com/subject/zribmftx.html