1.在关键字和参数之间必须有两个空格区分
2.每个testcases必须有2个字符的缩进
*** Test Cases ***
Test Robot Framework Logging #用例名称
Log "Test Logging" #关键字Log,参数Test Logging
3.变量的类型
(1)标量变量:${scalar},使用标量变量时,测试数据的值被分配的值所代替
(2)列表变量:@{LIST},列表变量的值是可以分配多个值给它
*** Test Cases ***
Test My Logging
My Logging "Test My Logging 1" "Test My Logging 2"
*** Keywords ***
My Logging
[Arguments] @{arg}
Log Many @{arg}
My Logging
[Arguments] ${msg} ${level}
Log ${msg} ${level}
4.robot内置模块
(1)Log
(2)Log Many
5.关键字可以单独写一个文件,在robot文件中引入就可以
*** Setting ***
Resource resource-1.txt
关键字文件命名为resource-1.txt
*** Keywords ***
My Logging
[Arguments] ${msg1} ${msg2}
Log Many ${msg1} ${msg2} ${msg1}
ZhangLu
[Arguments] @{arg}
Log Many @{arg}