机器人固件:内置库:"Pass Execution"关键字



参考文档

在任何设置或

拆卸(套件、测试或关键字(中使用时,通过该设置或拆卸。执行已启动关键字的可能关键字拆解。否则不会影响执行或状态。

你能用简单的例子详细说明上述陈述是什么意思吗?

意味着如果你在套件、测试或关键字上使用,Pass Execution之后的所有代码都不会被调用。

例:

*** Settings ***
Suite Setup       Setup
Suite Teardown    Teardown
*** Keywords ***
Setup
Pass Execution    Setup passed
Log to Console    Setup
Teardown
Pass Execution    Teardown passed
Log to Console    Teardown
*** Test Cases ***
Keyword1
Pass Execution    Keyword1 passed
Log    Test

Pass Execution的工作方式类似于 python 中的return,使用 PASS 退出关键字、测试用例、拆解或设置。 尝试注释"传递执行",然后您可以看到正在执行的剩余代码

最新更新