博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
RobotFramework-关键字-Wait Until Keyword Succeeds
阅读量:4168 次
发布时间:2019-05-26

本文共 959 字,大约阅读时间需要 3 分钟。

背景:因登录接口使用的是tesseract-ocr识别的验证码,所以存在识别错误的情况,可以使用Wait Until Keyword Succeeds关键字

Arguments:

[ retry | retry_interval | name | *args ]
Runs the specified keyword and retries if it fails. 
name and args define the keyword that is executed similarly as with `Run Keyword`. How long to retry running the keyword is defined using retry argument either as timeout or count. retry_interval is the time to wait before trying to run the keyword again after the previous run has failed. 
If retry is given as timeout, it must be in Robot Framework's time format (e.g. 1 minute, 2 min 3 s, 4.5) that is explained in an appendix of Robot Framework User Guide. If it is given as count, it must have times or x postfix (e.g. 5 times, 10 x). retry_interval must always be given in Robot Framework's time format. 
If the keyword does not succeed regardless of retries, this keyword fails. If the executed keyword passes, its return value is returned. 

 总计等待60s,如果login失败,每2s重试一次直到成功

转载地址:http://nlgxi.baihongyu.com/

你可能感兴趣的文章
2018.3.21
查看>>
2018.3.22
查看>>
2018.3.23
查看>>
A Game of Thrones(102)
查看>>
2018.4.29
查看>>
2018.4.30
查看>>
2018.4.31
查看>>
2018.4.32
查看>>
2018.4.33
查看>>
《python基础教程》答案(第一章)
查看>>
2018.4.34
查看>>
2018.4.35
查看>>
2018.4.36
查看>>
我为什么要写博客
查看>>
如何导入pycharm无法导入的包
查看>>
2018.4.37
查看>>
2018.4.38
查看>>
2018.4.39
查看>>
2018.4.40
查看>>
2018.5.27
查看>>