gpt4 book ai didi

robotframework - 我可以在 robotframework 中使用关键字作为参数吗?

转载 作者:行者123 更新时间:2023-12-04 06:40:17 30 4
gpt4 key购买 nike

我想用 Screen Should ContainScreen Should Not Contain 替换 ${assertion_Keyword} 所以我想像关键字一样放置参数

check_element_and_its_representation      
[Arguments] ${assertion_Keyword} ${payload} ${on_click_payload}
${assertion_Keyword} ${payload}
SikuliLibrary.Click ${payload}
Screen Should Contain ${on_click_payload}

使用这段代码,我编写了一个语法错误,没有找到关键字: enter image description here

这个 Action 怎么可能?还有其他方法吗?

谢谢。

最佳答案

运行关键字命令将帮助您。以下是受您的示例代码启发的示例。我已经注释掉了 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

关于robotframework - 我可以在 robotframework 中使用关键字作为参数吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50910818/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com