简体   繁体   English

无法使用“AND”条件为机器人框架中的多个变量设置套件变量

[英]Unable to Set Suite Variable for multiple variables in robot framework using "AND" condition

I'm trying Set Suite Variable for multiple variables in Robot Framework (RIDE tool, keyword driven) using "AND" condition, but not able to.我正在尝试使用“AND”条件为 Robot Framework(RIDE 工具,关键字驱动)中的多个变量设置套件变量,但不能。

The below is my script:下面是我的脚本:

 Set Suite Variable    ${username} AND    
 ${password} AND    
 ${URL} AND   
 ${Browser}

Error im facing:我面临的错误:

Invalid variable syntax '${username} AND'.无效的变量语法“${username} AND”。

pip list:点列表:

robotframework                          3.1.2
[...]
selenium                                3.8.1

Do let me know if any missing from my end.如果有任何遗漏,请告诉我。 Thanks in advance!提前致谢!

You can only set one variable at a time.一次只能设置一个变量。 Set suite variable doesn't support AND. 设置套件变量不支持 AND。

Since Set Suite Variable does not support setting multiple variables at once but you still want to do it in a single line I would try with Run Keywords instead:由于Set Suite Variable不支持一次设置多个变量,但您仍然想在一行中进行设置,我会尝试使用Run Keywords

Run Keywords    Set Suite Variable    ${VAR1}    value1    AND    Set Suite Variable    ${VAR2}    value2

But probably the cleanest way would be to have a keyword where your variables are set但可能最干净的方法是设置一个关键字来设置变量

*** Keywords ***
Set Variables
    Set Suite Variable    ${VAR1}    value1
    Set Suite Variable    ${VAR2}    value2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在机器人框架的变量部分动态设置变量 - Dynamically set a variable in variables section of robot framework 无法使用 Robot Framework 的 --Variable 为不同的浏览器运行 - Unable to run for different browsers using --Variable of Robot Framework 命令行Varaible不会覆盖Robot Framework中的套件级变量 - Command Line Varaible is not overriding Suite Level Variable in Robot Framework 有没有办法使用多个关键字动态构建机器人框架套件设置? - Is there a way to dynamically build a robot framework suite setup with multiple keywords? 机器人框架:使用“关闭所有浏览器”时,套件拆解失败 - Robot Framework: Suite Teardown fails when using Close All Browsers 机器人框架使用 if 条件识别卡片类型 - Robot framework identify card types using if condition 需要一种在一个关键字中设置变量并在另一个关键字中访问它而又不返回机器人框架中变量的方法 - Need a way to set a variable in one keyword and access it in another without returning the variables in robot framework 如何在 Robot Framework 中设置带有特殊字符的变量 - How to set variable with special characters in Robot Framework 在 Robot 框架中将变量从一个测试用例传递到另一个测试用例(不使用全局变量) - Pass variables from one test case to another in Robot framework (Not using global variable) 如何在机器人框架中并行运行多个测试套件上的多个测试用例 | Python - How to run multiple test case on multiple test suite parallely in robot framework | Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM