Robot Language¶
Robot Framework Language
Example with different Robot Framework language constructs.
Visit https://robocorp.com/docs-robot-framework/languages-and-frameworks/robot-framework for more information.
1 failed, 32 passed, 0 skiped, 33 total
Executed in 125 ms on March 17, 2024 at 11:53:00
Source /home/chme/git/python-robot-markdown/examples/Robot_Language
Statistics
| Pass / Fail / Skip | Total / Elapsed | |
|---|---|---|
FAIL Robot Language | 32 / 1 / 0 | 33 / 125 ms |
PASS Robot Language.For Loop | 8 / 0 / 0 | 8 / 34 ms |
PASS Robot Language.If Else | 8 / 0 / 0 | 8 / 27 ms |
PASS Robot Language.Try Except Finally | 12 / 0 / 0 | 12 / 22 ms |
FAIL Robot Language.While Loop | 4 / 1 / 0 | 5 / 21 ms |
For Loop PASS¶
Example test cases with FOR loops
0 fail, 8 pass, 0 skip, 8 total
Executed in 34 ms
Loop a list PASS¶
Executed in 4 ms
Log ${LIST}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
FOR ${item} IN [ @{LIST} ]
Executed in 1 ms
ITERATION ${item} = one
Executed in 1 ms
Log ${item}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${item} = two
Executed in 0 ms
Log ${item}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${item} = three
Executed in 0 ms
Log ${item}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
FOR ${item} IN [ one two three ]
Executed in 1 ms
ITERATION ${item} = one
Executed in 0 ms
Log ${item}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${item} = two
Executed in 0 ms
Log ${item}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${item} = three
Executed in 1 ms
Log ${item}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
Loop a dictionary PASS¶
Executed in 4 ms
Log ${DICTIONARY}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
FOR ${key_value_tuple} IN [ &{DICTIONARY} ]
Executed in 1 ms
ITERATION ${key_value_tuple} = ('string', 'cat')
Executed in 0 ms
Log ${key_value_tuple}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${key_value_tuple} = ('number', 1)
Executed in 1 ms
Log ${key_value_tuple}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${key_value_tuple} = ('list', ['one', 'two', 'three'])
Executed in 0 ms
Log ${key_value_tuple}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
FOR ${key} IN [ @{DICTIONARY} ]
Executed in 2 ms
ITERATION ${key} = string
Executed in 1 ms
Log ${key}=${DICTIONARY}[${key}]
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${key} = number
Executed in 0 ms
Log ${key}=${DICTIONARY}[${key}]
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${key} = list
Executed in 1 ms
Log ${key}=${DICTIONARY}[${key}]
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
Loop a range from 0 to end index PASS¶
Executed in 4 ms
FOR ${index} IN RANGE [ 10 ]
Executed in 4 ms
ITERATION ${index} = 0
Executed in 1 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 1
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 2
Executed in 1 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${index} = 3
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 4
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 5
Executed in 1 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${index} = 6
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 7
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 8
Executed in 1 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 9
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Loop a range from start to end index PASS¶
Executed in 3 ms
FOR ${index} IN RANGE [ 1 10 ]
Executed in 3 ms
ITERATION ${index} = 1
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 2
Executed in 1 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${index} = 3
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 4
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 5
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 6
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 7
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 8
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 9
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Loop a range from start to end index with steps PASS¶
Executed in 2 ms
FOR ${index} IN RANGE [ 0 10 2 ]
Executed in 2 ms
ITERATION ${index} = 0
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 2
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 4
Executed in 1 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${index} = 6
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${index} = 8
Executed in 0 ms
Log ${index}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Nest loops PASS¶
Executed in 6 ms
@{alphabets} = Create List a b c
Returns a list containing given items.
BuiltIn.Create List
Executed in 0 ms
Log ${alphabets}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
@{numbers} = Create List ${1} ${2} ${3}
Returns a list containing given items.
BuiltIn.Create List
Executed in 0 ms
Log ${numbers}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
FOR ${alphabet} IN [ @{alphabets} ]
Executed in 4 ms
ITERATION ${alphabet} = a
Executed in 1 ms
FOR ${number} IN [ @{numbers} ]
Executed in 1 ms
ITERATION ${number} = 1
Executed in 0 ms
Log ${alphabet}${number}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${number} = 2
Executed in 1 ms
Log ${alphabet}${number}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${number} = 3
Executed in 0 ms
Log ${alphabet}${number}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${alphabet} = b
Executed in 2 ms
FOR ${number} IN [ @{numbers} ]
Executed in 1 ms
ITERATION ${number} = 1
Executed in 1 ms
Log ${alphabet}${number}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${number} = 2
Executed in 0 ms
Log ${alphabet}${number}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${number} = 3
Executed in 0 ms
Log ${alphabet}${number}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${alphabet} = c
Executed in 1 ms
FOR ${number} IN [ @{numbers} ]
Executed in 1 ms
ITERATION ${number} = 1
Executed in 0 ms
Log ${alphabet}${number}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${number} = 2
Executed in 0 ms
Log ${alphabet}${number}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${number} = 3
Executed in 1 ms
Log ${alphabet}${number}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Exit a loop on condition PASS¶
Executed in 4 ms
FOR ${i} IN RANGE [ 5 ]
Executed in 2 ms
ITERATION ${i} = 0
Executed in 1 ms
IF ${i} == 2
Executed in 0 ms
BREAK
Executed in 0 ms
Log ${i}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${i} = 1
Executed in 1 ms
IF ${i} == 2
Executed in 0 ms
BREAK
Executed in 0 ms
Log ${i}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${i} = 2
Executed in 0 ms
IF ${i} == 2
Executed in 0 ms
BREAK
Executed in 0 ms
Log ${i}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Continue a loop from the next iteration on condition PASS¶
Executed in 3 ms
FOR ${i} IN RANGE [ 3 ]
Executed in 2 ms
ITERATION ${i} = 0
Executed in 1 ms
IF ${i} == 1
Executed in 1 ms
CONTINUE
Executed in 0 ms
Log ${i}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${i} = 1
Executed in 1 ms
IF ${i} == 1
Executed in 0 ms
CONTINUE
Executed in 0 ms
Log ${i}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${i} = 2
Executed in 0 ms
IF ${i} == 1
Executed in 0 ms
CONTINUE
Executed in 0 ms
Log ${i}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
If Else PASS¶
Example test cases with IF conditions
0 fail, 8 pass, 0 skip, 8 total
Executed in 27 ms
Use IF construct in Robot Framework PASS¶
Executed in 6 ms
IF ${True}
Executed in 1 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
IF ${False}
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF "cat" == "cat"
Executed in 0 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF "cat" != "dog"
Executed in 0 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF "cat" == "dog"
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF "cat" == "cat" and "dog" == "dog"
Executed in 1 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF "cat" == "cat" and "dog" == "cat"
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF 1 == 1
Executed in 1 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
IF 2 < 1
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF 2 <= 2
Executed in 0 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF len("cat") == 3
Executed in 1 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF (1 == 1 and 2 == 2) and 3 == 3
Executed in 0 ms
Log This line IS executed since the expressions evaluate to True.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF (1 == 2 or 3 == 4) or 3 == 3
Executed in 1 ms
Log This line IS executed since one of the expressions evaluates to True.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Use inline IF construct in Robot Framework PASS¶
Executed in 1 ms
IF "cat" == "cat"
Executed in 1 ms
Log This is logged.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ELSE
Executed in 0 ms
Log This is NOT logged.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Use IF / ELSE construct in Robot Framework PASS¶
Executed in 2 ms
IF 1 == 1
Executed in 1 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF 1 == 2
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE
Executed in 0 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Use IF / ELSE IF construct in Robot Framework PASS¶
Executed in 2 ms
IF 1 == 1
Executed in 0 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE IF 2 == 2
Executed in 1 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF 1 == 2
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE IF 2 == 2
Executed in 0 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF 1 == 2
Executed in 1 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ELSE IF 2 == 3
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Use IF / ELSE IF / ELSE construct in Robot Framework PASS¶
Executed in 3 ms
IF 1 == 1
Executed in 1 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE IF 2 == 2
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF 1 == 2
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE IF 2 == 2
Executed in 1 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ELSE
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
IF 1 == 2
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE IF 2 == 3
Executed in 0 ms
Log This line is NOT executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE
Executed in 1 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
Use Run Keyword If in Robot Framework PASS¶
Executed in 1 ms
Run Keyword If ${True} Log This line IS executed.
Runs the given keyword with the given arguments, if condition is true.
BuiltIn.Run Keyword If
Executed in 1 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Run Keyword If ${False} Log This line is NOT executed.
Runs the given keyword with the given arguments, if condition is true.
BuiltIn.Run Keyword If
Executed in 0 ms
Use Run Keyword Unless in Robot Framework PASS¶
Executed in 1 ms
Run Keyword Unless ${True} Log This line is NOT executed.
DEPRECATED since RF 5.0. Use Native IF/ELSE or Run Keyword If instead.
BuiltIn.Run Keyword Unless
Executed in 0 ms
Run Keyword Unless ${False} Log This line IS executed.
DEPRECATED since RF 5.0. Use Native IF/ELSE or Run Keyword If instead.
BuiltIn.Run Keyword Unless
Executed in 1 ms
Log This line IS executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Execute a for loop only three times PASS¶
Executed in 6 ms
FOR ${robot} IN [ @{ROBOTS} ]
Executed in 6 ms
ITERATION ${robot} = Bender
Executed in 4 ms
IF $robot == 'Terminator'
Executed in 3 ms
CONTINUE
Executed in 0 ms
Log ${robot}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${robot} = Johnny5
Executed in 1 ms
IF $robot == 'Terminator'
Executed in 0 ms
CONTINUE
Executed in 0 ms
Log ${robot}
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION ${robot} = Terminator
Executed in 0 ms
IF $robot == 'Terminator'
Executed in 0 ms
CONTINUE
Executed in 0 ms
Log ${robot}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION ${robot} = Robocop
Executed in 1 ms
IF $robot == 'Terminator'
Executed in 1 ms
CONTINUE
Executed in 0 ms
Log ${robot}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Try Except Finally PASS¶
Example test cases with TRY EXCEPT FINALLY
0 fail, 12 pass, 0 skip, 12 total
Executed in 22 ms
TRY / EXCEPT: Catch any exception PASS¶
Executed in 2 ms
TRY
Executed in 0 ms
Fail
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 0 ms
EXCEPT
Executed in 1 ms
Log EXCEPT with no arguments catches any exception.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
TRY / EXCEPT: Catch an exception by exact message PASS¶
Executed in 2 ms
TRY
Executed in 0 ms
Fail Error message
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 0 ms
EXCEPT Error message
Executed in 1 ms
Log Catches only "Error message" exceptions.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
Log Enables error-specific exception handling.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
TRY / EXCEPT: Multiple EXCEPT statements PASS¶
Executed in 2 ms
TRY
Executed in 0 ms
Fail Error message
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 0 ms
EXCEPT Another error message
Executed in 0 ms
Log Catches only "Another error message" exceptions.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
EXCEPT Error message
Executed in 1 ms
Log Catches the "Error message" exception.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
TRY / EXCEPT: Multiple messages in EXCEPT statement PASS¶
Executed in 1 ms
TRY
Executed in 1 ms
Fail CCC
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 1 ms
EXCEPT AAA BBB CCC
Executed in 0 ms
Log Catches any "AAA", "BBB", or "CCC" exception.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
TRY / EXCEPT: Catch a specific exception, or an unexpected exception PASS¶
Executed in 1 ms
TRY
Executed in 0 ms
Fail Error message
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 0 ms
EXCEPT Another message
Executed in 0 ms
Log Catches only "Another message" exceptions.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
EXCEPT
Executed in 1 ms
Log Catches any exception.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
Log Useful for handling unexpected exceptions.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
TRY / EXCEPT: Catch exceptions where the message starts with PASS¶
Executed in 1 ms
TRY
Executed in 0 ms
Fail A long error message with lots of details
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 0 ms
EXCEPT A long error message type=start
Executed in 1 ms
Log Matches the start of an error message.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
TRY / EXCEPT: Capture the error message PASS¶
Executed in 1 ms
TRY
Executed in 1 ms
Fail Goodbye, world!
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 1 ms
EXCEPT
Executed in 0 ms
Log ${error_message}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
TRY / EXCEPT: Using ELSE when no exceptions occured PASS¶
Executed in 2 ms
TRY
Executed in 0 ms
Log All good!
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
EXCEPT Error message
Executed in 0 ms
Log An error occured.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE
Executed in 1 ms
Log No error occured.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
TRY / EXCEPT / FINALLY: Always execute code no matter if exceptions or not PASS¶
Executed in 2 ms
TRY
Executed in 1 ms
Log All good!
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
FINALLY
Executed in 0 ms
Log FINALLY is always executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
TRY
Executed in 0 ms
Fail Catastrophic failure!
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 0 ms
EXCEPT
Executed in 1 ms
Log Catches any exception.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
FINALLY
Executed in 0 ms
Log FINALLY is always executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
TRY / EXCEPT / ELSE / FINALLY: All together! PASS¶
Executed in 2 ms
TRY
Executed in 0 ms
Fail Error message
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 0 ms
EXCEPT
Executed in 0 ms
Log Executed if any exception occurs.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ELSE
Executed in 1 ms
Log Executed if no exceptions occur.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
FINALLY
Executed in 0 ms
Log FINALLY is always executed.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
TRY / EXCEPT: Glob pattern matching PASS¶
Executed in 2 ms
TRY
Executed in 0 ms
Fail My error: 99 occured
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 0 ms
EXCEPT My error: * type=glob
Executed in 0 ms
Log Catches by glob pattern matching.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
TRY / EXCEPT: Regular expression matching PASS¶
Executed in 1 ms
TRY
Executed in 0 ms
Fail error 99 occured
Fails the test with the given message and optionally alters its tags.
BuiltIn.Fail
Executed in 0 ms
EXCEPT [Ee]rror \\d+ occured type=regexp
Executed in 0 ms
Log Catches by regular expression pattern matching.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
While Loop FAIL¶
Example test cases with WHILE loops
1 fail, 4 pass, 0 skip, 5 total
Executed in 21 ms
WHILE: A simple while loop using the default loop limit FAIL¶
Executed in 4 ms
WHILE loop was aborted because it did not finish within the limit of 10 iterations. Use the 'limit' argument to increase or remove the limit if needed.
WHILE True limit=10
Executed in 3 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 1 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 1 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 1 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
WHILE: Loop while the given limit is hit PASS¶
Executed in 5 ms
TRY
Executed in 4 ms
WHILE True limit=10
Executed in 4 ms
ITERATION
Executed in 1 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 1 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 1 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 1 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
ITERATION
Executed in 0 ms
Log Executed until the given loop limit (10) is hit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
EXCEPT WHILE loop was aborted type=start
Executed in 1 ms
Log The loop did not finish within the limit.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
WHILE: Loop while condition evaluates to True or the default loop limit is hit PASS¶
Executed in 4 ms
${x} = Set Variable ${0}
Returns the given values which can then be assigned to a variables.
BuiltIn.Set Variable
Executed in 0 ms
WHILE ${x} < 3
Executed in 3 ms
ITERATION
Executed in 2 ms
Log Executed as long as the condition is True.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
${x} = Evaluate ${x} + 1
Evaluates the given expression in Python and returns the result.
BuiltIn.Evaluate
Executed in 1 ms
ITERATION
Executed in 0 ms
Log Executed as long as the condition is True.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
${x} = Evaluate ${x} + 1
Evaluates the given expression in Python and returns the result.
BuiltIn.Evaluate
Executed in 0 ms
ITERATION
Executed in 1 ms
Log Executed as long as the condition is True.
Logs the given message with the given level.
BuiltIn.Log
Executed in 1 ms
${x} = Evaluate ${x} + 1
Evaluates the given expression in Python and returns the result.
BuiltIn.Evaluate
Executed in 0 ms
WHILE: Skip a loop iteration with CONTINUE PASS¶
Executed in 4 ms
${x} = Set Variable ${0}
Returns the given values which can then be assigned to a variables.
BuiltIn.Set Variable
Executed in 0 ms
WHILE ${x} < 3
Executed in 3 ms
ITERATION
Executed in 1 ms
${x} = Evaluate ${x} + 1
Evaluates the given expression in Python and returns the result.
BuiltIn.Evaluate
Executed in 0 ms
IF ${x} == 2
Executed in 0 ms
CONTINUE
Executed in 0 ms
Log x = ${x}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 1 ms
${x} = Evaluate ${x} + 1
Evaluates the given expression in Python and returns the result.
BuiltIn.Evaluate
Executed in 1 ms
IF ${x} == 2
Executed in 0 ms
CONTINUE
Executed in 0 ms
Log x = ${x}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
ITERATION
Executed in 1 ms
${x} = Evaluate ${x} + 1
Evaluates the given expression in Python and returns the result.
BuiltIn.Evaluate
Executed in 1 ms
IF ${x} == 2
Executed in 0 ms
CONTINUE
Executed in 0 ms
Log x = ${x}
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms
WHILE: Exit loop with BREAK PASS¶
Executed in 0 ms
WHILE True
Executed in 0 ms
ITERATION
Executed in 0 ms
BREAK
Executed in 0 ms
Log This will not be logged.
Logs the given message with the given level.
BuiltIn.Log
Executed in 0 ms