2016-04-28 10 views
2

Ich fragte mich, ob es möglich war, Robot Framework -Stdout von Konsole zu Datei umzuleiten? Derzeit, wenn ich Pybot ausführen, ist die Ausgabe in der Eingabeaufforderung (für Windows), kann ich es so ändern, dass es stattdessen in eine Datei gehen wird? (An der Eingabeaufforderung wird nichts angezeigt.)Robot Framework: Wie Konsolenausgabe in Datei umleiten

+1

Haben Sie die normale Art und Weise versucht, Ausgabe zu umleiten? 'Roboter ...> console.txt'? –

+0

Hi Bryan, ich denke das ist was ich brauche, obwohl ich es noch nicht ausprobiert habe. Mein Zweck ist es, die Konsolenausgabe in einem Log-Dashboard anzuzeigen, ähnlich wie es Jenkins in seiner Konsolenausgabe macht. Werde das später versuchen. Danke vielmals! – Ryan

Antwort

1

Neben dem Vorschlag von @Bryan, wenn Sie Ihre Ausgabe (xml, log, Bericht) umleiten möchten zu einem bestimmten Verzeichnis oder eine Datei, können Sie folgende Optionen für pybot Skript verwenden:

-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 
+0

Hallo @ Daemon12. Danke dafür. Mir ist jedoch bereits bewusst, dass Robot Framework dies hat. Ich wollte die Konsolenausgabe in Echtzeit erfassen und in einem Log-Dashboard anzeigen (ähnlich wie Jenkins in seinem Konsolenprotokoll). Ich denke, Bryan's Kommentar ist, wonach ich suche. :-) Vielen Dank! – Ryan

1

vielleicht möchten Sie es einfach anmelden Sie (im Falle von Jenkins) trösten:

*** Keywords *** 
Log To Current Console 
    [Arguments] ${TO_LOG} 
    Log To Console \n\n${TO_LOG} 

Oder manchmal ist es schön, die Debug Ihrer Roboter-Tests zu überprüfen:

-b --debugfile file  Debug file written during execution. Not created 
         unless this option is specified. 
0

auf einem Linux-Server können Sie Rohr nur der Roboter Command abschlagen

robot -d results <test name>.robot | tee <test name>.out 
Verwandte Themen