是否存在与Robot Framework中的“等待关键字成功完成”相同的关键字,还是我必须完全创建一个新关键字?我对框架还很陌生,希望实现以下目标:
Wait Until Keyword Succeeds 10x 20s
... ${response} = Some Keyword arg
... Should Match ${response} ${val}
还是有另一种方法来解决此问题?
答案 0 :(得分:2)
您可以通过将这些关键字排除在复合关键字中来实现:
My Keyword
[Arguments] ${argument} ${val}
${response} = Some Keyword ${argument}
Should Match ${response} ${val}
然后使用正确的属性在“等待关键字成功”下调用此关键字
Wait Until Keyword Succeeds My Keyword ${argument} ${val}
答案 1 :(得分:2)
由于您要运行多个关键字,因此有两种解决方案。一种是将这些多个关键字放在另一个关键字中,然后调用它。已经有another answer展示了如何做到这一点。
另一种解决方案是运行run keywords。例如:
*** Test Cases ***
Example
wait until keyword succeeds 30 seconds 10 seconds run keywords
... log this is one keyword
... AND log this could be a different keyword
... AND log and this could be another keyword