机器人框架中有静态类型变量之类的东西吗?如果是这样我该如何调用它?或者是通过 python 文件来实现的解决方案?
我试图解决的问题是,我希望设置一个变量一次并让它记住设置的值。不幸的是,这个变量位于资源文件中(它与我的测试套件文件分开)。
最佳答案
是的,您可以在机器人框架中设置静态变量。您的资源文件中应该有类似的内容。
*** Settings ***
...
*** Variables ***
${MyVariable} MyValue
*** Keywords ***
...
你的测试应该是这样的
*** Settings ***
Resource (Path to resource file)
*** Test Cases ***
My Test Case
[Documentation] This is documentation
My keyword MyVariable
关于python - Robot Framework 中的静态变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54109182/