我有一个关于Robot Framework的问题。我有这样的代码:如何失败特定的机器人关键字,但继续执行测试?
Run Keyword Unless '${Value}'=='49' Fail Incorrect counter value
它工作得很好,但关键字Fail
停止测试执行。我怎样才能失败特定的关键字,在上面的结构嵌套,但在测试中继续执行关键字?
我有一个关于Robot Framework的问题。我有这样的代码:如何失败特定的机器人关键字,但继续执行测试?
Run Keyword Unless '${Value}'=='49' Fail Incorrect counter value
它工作得很好,但关键字Fail
停止测试执行。我怎样才能失败特定的关键字,在上面的结构嵌套,但在测试中继续执行关键字?
你可以如下做到这一点:
Run Keyword And Continue On Failure Run Keyword Unless '${Value}'=='49' Fail Incorrect counter value
这将让你继续执行,即使这一步失败
在有内置的三个关键字可供选择:
Run Keyword And Continue On Failure
Run Keyword And Expect Error
Run Keyword And Ignore Error
考虑使用最适合的你的目的。 http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Run%20Keyword%20And%20Continue%20On%20Failure