如果元素被禁用,如何跳过剩余的测试用例并移动到下一个测试用例

问题描述 投票:0回答:1

如果元素被禁用,我想将执行移至下一个测试用例,它应该记录元素是启用还是禁用如果启用,则继续测试用例(剩余代码),如果禁用,则移至下一个测试用例跳过测试用例中的剩余代码 例如:

TC01
    Element Should Be Enabled  ${options}#if not skip the remaing code and go to next test case
    Click Element  ${abc}
TC02
     Element Should Be Enabled  ${options}#if enabled continue with the remaing code
    Click Element  ${abc}

如何在机器人框架中做到这一点?如果测试用例中的任何条件不满足,我们可以跳过测试用例的扩孔部分吗??

python robotframework
1个回答
0
投票

您可以使用内置的

Skip
Skip If
关键字。在此处查看它们的文档http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Skip

© www.soinside.com 2019 - 2024. All rights reserved.