有没有办法在 Robot 框架中注释多行。
在python中,我们有像'''和''''这样的选项。
最佳答案
没有块注释功能。但是,您可以使用一个微妙的小技巧来注释掉整个块。它没有记录为多行注释功能,但可以这样使用。
这个技巧的工作原理是知道机器人将忽略表中不是四个可识别表之一的任何数据:关键字、测试、设置或变量。如果您有其他表格,则在下一张表格之前的任何内容都将被忽略。
relevant section of the user guide说这个:
2.1.4 Rules for parsing the data
Ignored data
When Robot Framework parses the test data, it ignores:
- All tables that do not start with a recognized table name in the first cell.
- ...
例如:
*** Test Cases ***
| test 1
| | log | this is test one
*** comment ***
| test 2
| | log | this is test two
*** Test Cases ***
| test 3
| | log | this is test three
如果你运行上面的测试,你会看到只执行了 test 1 和 test3。 “评论”表中的所有内容都将被忽略。
关于robotframework - Robot 框架中的多行注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26129435/