一、Remove String Using Regexp
使用
1、${test} Remove String Using Regexp ${date} \\D 去除${date}字符串中非数字的字符
二、Get Substring
使用
1、${last_date} Get Substring ${time} (空格) 10 得到第0-9范围的字符(默认从0开始)
三、得到时间字符串
current_time = time.strftime("%Y%m%d%H%M%S",time.localtime(time.time()))
四、pip安装library包时不成功,提示如下:
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAI
LED] certificate verify failed (_ssl.c:661)'),)': /simple/faker/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAI
LED] certificate verify failed (_ssl.c:661)'),)': /simple/faker/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAI
LED] certificate verify failed (_ssl.c:661)'),)': /simple/faker/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAI
LED] certificate verify failed (_ssl.c:661)'),)': /simple/faker/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAI
LED] certificate verify failed (_ssl.c:661)'),)': /simple/faker/
Could not fetch URL https://pypi.python.org/simple/faker/: There was a problem
confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', por
t=443): Max retries exceeded with url: /simple/faker/ (Caused by SSLError(SSLErr
or(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)'
),)) - skipping
Could not find a version that satisfies the requirement Faker (from versions:
)
No matching distribution found for Faker
解决方案:
pip install Faker -i http://pypi.douban.com/simple/ --truste d-host pypi.douban.com
加入网络镜像
五、RF引入library时控制台报错
FAILED TestLibrary 'ascii' codec can't decode byte 0xe4 in position 0: ordinal n ot in range(20)
解决方案:
找到python2.7目录下的Lib文件夹中的ntpath.py文件,打开,找到def join(path, *paths): 这个方法下添加一下两行代码:
reload(sys) sys.setdefaultencoding('gbk') #或者utf-8