我想用Screen Should Contain
或Screen Should Not Contain
替换$ {assertion_Keyword},所以我想把一个Argument作为关键字
check_element_and_its_representation
[Arguments] ${assertion_Keyword} ${payload} ${on_click_payload}
${assertion_Keyword} ${payload}
SikuliLibrary.Click ${payload}
Screen Should Contain ${on_click_payload}
这个行动怎么可能?还有其他办法吗?
感谢。
答案 0 :(得分:4)
Run Keyword命令可以帮助您。下面是一个基于示例代码的示例。我已经注释掉了Sikuli关键字,但保留了它们并添加了两个关键字来模拟在Sikuly图书馆中找到的关键字。
*** Test Cases ***
TC Screen Should Contain
Check Element And Its Representation Screen Should Contain payload on_click_payload
TC Screen Should Not Contain
Check Element And Its Representation Screen Should Not Contain payload on_click_payload
*** Keywords ***
Check Element And Its Representation
[Arguments] ${assertion_Keyword}=Screen Should Contain ${payload}=None ${on_click_payload}=None
Run Keyword ${assertion_Keyword} ${payload}
# SikuliLibrary.Click ${payload}
# Screen Should Contain ${on_click_payload}
Screen Should Contain
[Arguments] ${var}
Log Screen Should Contain
Screen Should Not Contain
[Arguments] ${var}
Log Screen Should Contain