标准库 BuiltIn - 1
介绍:
- 标准库里面是经常用到的关键字,这个库不需要导入,自动导入,可直接使用
常用关键字
日志相关
- Log
- Log Many
- Log To Console
- Log Variables
实例
*** Variables ***
@{newList} tom kite rose
&{newDict} key=value k2=v2
${name} ghz
*** Test Cases ***
case01
Log hello
case02
Log To Console hello
case03
Log Many @{newList}
Log Many &{newDict}
case04
Log Variables
- Get Count
- Get Length
- Get Time
- Get Variables
- Get Variable Value
实例
*** Variables ***
@{newList} 1 1 1 2 2 3
*** Test Cases ***
case01
${count} Get Count ${newList} 1
Log ${count}
case02
${len} Get Length ${newList}
Log ${len}
case03
${item} Get Time
Log ${item}
case04
${vars} Get Variables
Log ${vars}
case05
${value} Get Variable Value ${EXECDIR}
Log ${value}
- Call Method
- Catenate
- Comment
- Evaluate
- No Operation
- Sleep
实例
*** Variables ***
@{newList} tom kite rose
*** Test Cases ***
case01
${res} Catenate @{newList}
Log ${res}
case02
Log case02
Comment 注释
case03
${res} Evaluate 1+2
Log ${res}
case04
No Operation
case05
Sleep 3
Log hello
标准库BuiltIn - 2
验证相关关键字
- Should Be Empty
- Should Be Equal
- Should Be Equal As Integers
- Should Be Equal As Numbers
- Should Be True
- Should Be Equal As Strings
*** Comments ***
这里是注释
*** Variables ***
@{newList}
*** Test Cases ***
case01
Should Be Empty ${newList}
case02
Should Be Equal 1 1
case03
Should Be Equal As Integers 0b101 5
case04
Should Be Equal As Numbers 1.23 1.24 precision=1
case05
Should Be Equal As Strings 3.14 ${3.14}
-
Should Contain
-
Should Contain Any
-
Should Contain X Times
-
Should End With
-
Should Match
-
Should Match Regexp
*** Comments ***
这里是注释
*** Variables ***
@{newList} item item
*** Test Cases ***
case01
Should Contain ${newList} item
case02
Should Contain Any ${newList} item item2
case03
Should Contain X Times ${newList} item 2
case04
Should End With dem.py py
case05
Should Match hello123 hello*
case06
Should Match Regexp 123 \\d{3}
- Should Not Be Empty
- Should Not Be Equal
- Should Not Be Equal As Integers
- Should Not Be Equal As Numbers
- Should Not Be Equal As Strings
- Should Not Be True
- Should Not Contain
- Should Not Contain Any
- Should Not End With
- Should Not Match
- Should Not Match Regexp
- Should Not Start With
- Should Start With
*** Comments ***
这里是注释
*** Variables ***
@{newList} item
*** Test Cases ***
case01
Should Not Be Empty ${newList}
case02
Should Not Be Equal 1 2
case03
Should Start With hello.py hell
标准库BuiltIn - 3
类型转换相关
- Convert To Boolean
- Convert To Bytes
- Convert To Hex
- Convert To Integer
- Convert To Number
- Convert To Octal
- Convert To String
*** Comments ***
这里是注释
*** Test C