I was wondering if it was possible to redirect Robot Framework's stdout from console to file? Currently, when I run pybot, the output is in the command prompt (for Windows), can I change it in such a way that it will go to a file instead? (Nothing displayed on the command prompt).
4 Answers
Maybe you just want to log it to you console (in case of Jenkins):
*** Keywords *** Log To Current Console [Arguments] ${TO_LOG} Log To Console \n\n${TO_LOG} Or sometimes it is nice to check the debug of your robot tests:
-b --debugfile file Debug file written during execution. Not created unless this option is specified. Comments
Apart from the suggestion from @Bryan, if you want to redirect your output (xml, log, report) to a particular directory or a file, you can use following options for pybot script:
-d --outputdir dir Where to create output files. The default is the directory where tests are run from and the given path is considered relative to that unless it is absolute. -o --output file XML output file. Given path, similarly as paths given to --log, --report, --xunit, and --debugfile, is relative to --outputdir unless given as an absolute path. Other output files are created based on XML output files after the test execution and XML outputs can also be further processed with Rebot tool. Can be disabled by giving a special value `NONE`. In this case, also log and report are automatically disabled. Default: output.xml -l --log file HTML log file. Can be disabled by giving a special value `NONE`. Default: log.html Examples: `--log mylog.html`, `-l NONE` -r --report file HTML report file. Can be disabled with `NONE` similarly as --log. Default: report.html 1 Comment
Lloyd Ryan David
Hi @Daemon12. Thanks for this. However, I'm already aware that Robot Framework has this. What I wanted was to capture real-time the console output and display it in a log dashboard (similar to what Jenkins does in its console log.) I think Bryan's comment is what I'm looking for. :-) Thanks!
robot ... > console.txt?