robotframework - Robot 框架中的多行注释

标签 robotframework

有没有办法在 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/

相关文章:

python-2.7 - 如何使用python检查机器人框架中的字典是否为空

testing - 在机器人框架中以毫秒为单位获取时间的关键字是什么?

python - 机器人框架: Create template

python - 机器人框架 : UnboundLocalError: local variable 'cellValue' referenced before assignment

android - 使用机器人框架脚本和 chromedriver 在 Android 设备中打开 Chrome 浏览器?

robotframework - 如何用机器人框架替换文件中的文本/字符串

python - 在robot framework中申请loop后,报错如下- Keyword name cannot be empty

python - 从 Python 中调用 Robot Framework 文件

python - 机器人框架中有没有一种方法可以仅在存在 True 时才记录 keywork?

selenium - 如何使用 SeleniumLibrary 关键字以不同用户身份启动浏览器?