http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Run%20Keyword%20If%20Any%20Critical%20Tests%20Failed
| ${all_var}= Get Variables
Log Many ${all_var} | Get Variables | no_decoration=False | |
| Import Library ${LIBRARIES}/Lib.java | Import Library | name, *args | |
| Import Resource ${CURDIR}/new.txt lognameaaa ${test_map} | Import Resource | path | |
| Import Variables ${CURDIR}/test.py
logname ${test_map} | Import Variables | path, *args | |
| 检查keyword是否存在 | Keyword Should Exist | name, msg=None | |
| Length Should Be abcdefg 7 | Length Should Be | item, length,msg=None | |
| Log ****hi log | Log | message, level=INFO,html=False,console=False,repr=False |
Logs the given message with the given level.
Valid levels are TRACE, DEBUG, INFO (default), HTML, WARN, and ERROR. Messages below the current active log level are ignored. See Set Log Level keyword and --loglevel command line option for more details about setting the level. Messages logged with the WARN or ERROR levels will be automatically visible also in the console and in the Test Execution Errors section in the log file. Logging can be configured using optional html, console and repr arguments. They are off by default, but can be enabled by giving them a true value. See Boolean arguments section for more information about true and false values. If the html argument is given a true value, the message will be considered HTML and special characters such as < in it are not escaped. For example, logging creates an image when html is true, but otherwise the message is that exact string. An alternative to using the html argument is using the HTML pseudo log level. It logs the message as HTML using the INFO level.If the console argument is true, the message will be written to the console where test execution was started from in addition to the log file. This keyword always uses the standard output stream and adds a newline after the written message. Use Log To Console instead if either of these is undesirable, If the repr argument is true, the given item will be passed through a custom version of Python's pprint.pformat() function before logging it. This is useful, for example, when working with strings or bytes containing invisible characters, or when working with nested data structures. The custom version differs from the standard one so that it omits the u prefix from Unicode strings and adds b prefix to byte strings. Examples: Log Hello, world! # Normal INFO message. Log Warning, world! WARN # Warning. Log Hello, world! html=yes # INFO message as HTML. Log Hello, world! HTML # Same as above. Log Hello, world! DEBUG html=true # DEBUG as HTML. Log Hello, console! console=yes # Log also to the console. Log Hyvä \x00 repr=yes # Log 'Hyv\xe4 \x00'. See Log Many if you want to log multiple messages in one go, and Log To Console if you only want to write to the console. Arguments html, console, and repr are new in Robot Framework 2.8.2. Pprint support when repr is used is new in Robot Framework 2.8.6, and it was changed to drop the u prefix and add the b prefix in Robot Framework 2.9. |
| Log Many ******${var} DEBUG aaaaT 打印多个值的log | Log Many | *messages |
Logs the given messages as separate entries using the INFO level.
Supports also logging list and dictionary variable items individually. Examples: Log Many Hello ${var} Log Many @{list} &{dict} See Log and Log To Console keywords if you want to use alternative log levels, use HTML, or log to the console. |
Log To Console Hell try Log To Console Log To Console Hell try Log To Console STDERR STDERR PS: 屏幕输出 很好用的和 Log 有相同的效果 | Log To Console | message,stream=STDOUT,no_newline=False |
Logs the given message to the console.
By default uses the standard output stream. Using the standard error stream is possibly by giving the stream argument value STDERR (case-insensitive). By default appends a newline to the logged message. This can be disabled by giving the no_newline argument a true value (see Boolean arguments). Examples: Log To Console Hello, console! Log To Console Hello, stderr! STDERR Log To Console Message starts here and is no_newline=true Log To Console continued without newline. This keyword does not log the message to the normal log file. Use Log keyword, possibly with argument console, if that is desired. New in Robot Framework 2.8.2. |
creates an image when html is true, but otherwise the message is that exact string. An alternative to using the html argument is using the HTML pseudo log level. It logs the message as HTML using the INFO level.
没有评论:
发表评论