如何使用关键字跳过Robot框架中的测试用例 [英] How to skip test case in Robot framework using keyword

查看:93
本文介绍了如何使用关键字跳过Robot框架中的测试用例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用关键字跳过特定的测试用例,是否有任何关键字可以做到这一点?我想要做的是检查文件名是否有跳过"字样,然后我想跳过它.是否有任何关键字,如:Skip Test , Skip Execution If ...

i'm trying to skip a specific test case using keyword, is there are any keyword to do that ? what i'm trying to do is to check if file name have "skip" word then i want to skip it. is there are any keyword like : Skip Test , Skip Execution If ...

@{regex}=  Get Regexp Matches  ${TEST NAME}  Skip
${lenght}=  Get Length  ${regex}
Skip Execution If  '${lenght}'>'0'  

推荐答案

理想情况下,不应该运行的测试应该使用标签或其他方式从运行中排除.另一种选择是仍然运行测试,但只需在测试开始时检查您的跳过条件并通过测试而不执行任何操作.有两个关键字,Builtin.Pass ExecutionBuiltin.Pass Execution If,对此很有用.

Ideally, tests that should not be run should be excluded from the run using tags or other means. Another option is to still run the tests, but simply check for your skip condition at the start of the test and pass the test without executing anything. There are two keywords, Builtin.Pass Execution and Builtin.Pass Execution If, useful for that.

http://robotframework.org/robotframework/latest/图书馆/BuiltIn.html#Pass%20Execution%20If

这篇关于如何使用关键字跳过Robot框架中的测试用例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆