How to use Call Method for printing some info to console

1,233 views
Skip to first unread message

jun mi

unread,
May 24, 2012, 10:15:29 PM5/24/12
to robotframe...@googlegroups.com
I  just want print some debug info to console,  so  I want to use Call Method .

${path}= Get Environment Variable PATH
Call Method print ${path}


and run failed ,failed log is Object 'print' does not have a method

thank you for telling me how to use it.

Jussi Malinen

unread,
May 25, 2012, 5:48:18 AM5/25/12
to mij...@gmail.com, robotframe...@googlegroups.com
Hi!

Normally the way to do logging in robot is to use the "log"-keyword.
This does not write the output to console, but instead to the
generated log file.

As a side note, if you log using the warn-level, the warning will also
be written to console, but that might not be the best idea in this
case.

In the user guide the chapter "logging to console" [1] shows how to
create your own library that writes messages to console during the run
time. Just create the library with the content in the example listing
and then you can use the keyword "log to console".

I would still suggest that you use the keyword log and check the value
from the log file after the execution. That is a more maintainable
solution in the long term.

Cheers,
Jussi

[1] http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.7.1#logging-information


--
Jussi Malinen / Robot Framework
Reaktor, www.reaktor.fi
> --
> You received this message because you are subscribed to the Google Groups
> "robotframework-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/robotframework-users/-/2sB2oHbetVUJ.
> To post to this group, send email to robotframe...@googlegroups.com.
> To unsubscribe from this group, send email to
> robotframework-u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/robotframework-users?hl=en.
Reply all
Reply to author
Forward
0 new messages