html tool

2017年10月23日星期一

robotframe 内嵌关键字的用法补遗II

http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Call%20Method


Test Teardown Run Keyword If Test Passed logname pass_${TESTNAME}

?teardown 设置多条要如何做呢??
Run Keyword If Test Passedname, *args
Test Teardown Run Keyword If Timeout Occurred wait logname ${var}
LOGP Log Pass
[Timeout] 2 seconds
Sleep 60 seconds
Run Keyword If Timeout Occurredname, *args
Run Keyword Unless '${var}'!='aaa' logname ${var} Run Keyword Unlesscondition, name, *args
Run Keywords logname ${var} AND login with user AND Show logRun Keywords*keywords
Executes all the given keywords in a sequence.
This keyword is mainly useful in setups and teardowns when they need to take care of multiple actions and creating a new higher level user keyword would be an overkill.
By default all arguments are expected to be keywords to be executed.
Examples:
Run Keywords Initialize database Start servers Clear logs Run Keywords ${KW 1} ${KW 2} Run Keywords @{KEYWORDS}
Starting from Robot Framework 2.7.6, keywords can also be run with arguments using upper case AND as a separator between keywords. The keywords are executed so that the first argument is the first keyword and proceeding arguments until the first ANDare arguments to it. First argument after the first AND is the second keyword and proceeding arguments until the next AND are its arguments. And so on.
Examples:
Run Keywords Initialize database db1 AND Start servers server1 server2 Run Keywords Initialize database ${DB NAME} AND Start servers @{SERVERS} AND Clear logs Run Keywords ${KW} AND @{KW WITH ARGS}
Notice that the AND control argument must be used explicitly and cannot itself come from a variable. If you need to use literal AND string as argument, you can either use variables or escape it with a backslash like \AND.
Set Global Variable ${var} globalaaaSet Global Variablename, *values
Set Library Search Order*search_order
Sets the resolution order to use when a name matches multiple keywords.
The library search order is used to resolve conflicts when a keyword name in the test data matches multiple keywords. The first library (or resource, see below) containing the keyword is selected and that keyword implementation used. If the keyword is not found from any library (or resource), test executing fails the same way as when the search order is not set.
When this keyword is used, there is no need to use the long LibraryName.Keyword Name notation. For example, instead of having
MyLibrary.Keyword arg MyLibrary.Another Keyword MyLibrary.Keyword xxx
you can have
Set Library Search Order MyLibrary Keyword arg Another Keyword Keyword xxx
This keyword can be used also to set the order of keywords in different resource files. In this case resource names must be given without paths or extensions like:
Set Library Search Order resource another_resource
NOTE:
The search order is valid only in the suite where this keywords is used. Keywords in resources always have higher priority than keywords in libraries regardless the search order. The old order is returned and can be used to reset the search order later. Library and resource names in the search order are both case and space insensitive.
? 设置后的不同之处如何查看呢?
Set Log Level TRACE
Set Log Levellevel
Sets the log threshold to the specified level and returns the old level.
Messages below the level will not logged. The default logging level is INFO, but it can be overridden with the command line option --loglevel.
The available levels: TRACE, DEBUG, INFO (default), WARN, ERROR and NONE (no logging).

没有评论:

发表评论