When a keyword has a print
statements, does that output actually go anywhere when the test is run? for example:
Lib.py
def message(msg):
print 'your message is ' + msg
return True
Tests.robot
*** Settings ***
Library Lib
*** Test Cases ***
Case1
message "hello"
If I run pybot Tests.robot
, is there anywhere I can see the 'your message is hello'
get printed, or does that output just go nowhere?
Yes, they are captured and entered as LOG entries into the output.
After you run your test, open the log.html, go to the entry where your libraries keyword is called, and you will see a LOG entry with the output of your print statement in it.
RobotFramework Library Logging Information
Logging information
Exception messages are not the only way to give information to the users. In addition to them, methods can also send messages to log files simply by writing to the standard output stream (stdout) or to the standard error stream (stderr), and they can even use different log levels. Another, and often better, logging possibility is using the programmatic logging APIs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With