注意robot的case格式
# *** Variables *** # *** Settings ***
# Library String
# Library Selenium2Library *** Test Cases ***
test case1
log Robot Framework
log Python test case2
${a} set variable Javascript
log ${a} test case3
${hi} catenate hello world
log ${hi} test case4
${str} catenate SEPARATOR=-- hello world
log ${str} test case5-list
@{abc} create list a b c
log many @{abc} test case6-get time
${t} get time
log ${t}
查看运行结果:
Starting test: Rf Test.Helloworld.test case1
20180519 10:30:18.990 : INFO : Robot Framework
20180519 10:30:18.992 : INFO : Python
Ending test: Rf Test.Helloworld.test case1 Starting test: Rf Test.Helloworld.test case2
20180519 10:30:18.997 : INFO : ${a} = Javascript
20180519 10:30:18.998 : INFO : Javascript
Ending test: Rf Test.Helloworld.test case2 Starting test: Rf Test.Helloworld.test case3
20180519 10:30:19.001 : INFO : ${hi} = hello world
20180519 10:30:19.002 : INFO : hello world
Ending test: Rf Test.Helloworld.test case3 Starting test: Rf Test.Helloworld.test case4
20180519 10:30:19.006 : INFO : ${str} = hello--world
20180519 10:30:19.007 : INFO : hello--world
Ending test: Rf Test.Helloworld.test case4 Starting test: Rf Test.Helloworld.test case5-list
20180519 10:30:19.011 : INFO : @{abc} = [ a | b | c ]
20180519 10:30:19.012 : INFO : a
20180519 10:30:19.012 : INFO : b
20180519 10:30:19.013 : INFO : c
Ending test: Rf Test.Helloworld.test case5-list Starting test: Rf Test.Helloworld.test case6-get time
20180519 10:30:19.017 : INFO : ${t} = 2018-05-19 10:30:19
20180519 10:30:19.020 : INFO : 2018-05-19 10:30:19
Ending test: Rf Test.Helloworld.test case6-get time