2018 up to now | 2017 | 2016 | 2015 | 2014 | 2013 | 2012

Mailing List - Entries of 2016


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QF-Test] Logging output of Java objects used by Jython scripts


  • Subject: Re: [QF-Test] Logging output of Java objects used by Jython scripts
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: Wed, 23 Nov 2016 09:34:53 +0100

Hello Bernhard,

when printing with Jython you may get the output in the Terminal
automatically. If not, try opening the SUT Jython terminal from the
Client menu and it should appear there.

Print statements inside Java objects will only appear in the terminal
if output from the SUT is not generally detached/redirected by the SUT
itself during startup. Java WebStart is a typical example where you'll
not get any output to QF-Test's terminal but only to the Java console
or to log files.

Either way, QF-Test intercepts all SUT output and logs it in the
run-log during replay.

Regarding logging messages / errors from the Java objects: You'll need
some form of Jython wrapper that does the actual logging. When running
directly in an SUT script rc is available and you can use
rc.logMessage etc. When running asynchronously, e.g. inside a resolver
that is also called during recording, use qf.logMessage instead.

Best regards,
    Greg

Bernhard Schmitt <bernhard.schmitt@?.de> writes:

> Hello,
>
> in some Jython scripts, I am using Java objects.
> - How can I log the standard outputs of the Java objects (System.out.print("something")) in the QF-Test Terminal window?
> - How can I log special errors or messages oft the Java objects in the
> *.qrz report? I am thinking of using the variable "rc" as parameter
> for a special method and then using rc.logError() and rc.logMessage(),
> but I am not sure if this ist a good way.
>
> BR
>
> Bernhard

--
Gregor Schmid

E: gregor.schmid@?.de
T: +49 8171 38648-11
F: +49 8171 38648-16

Quality First Software GmbH | www.qfs.de
Tulpenstr. 41 | 82538 Geretsried | Germany
GF Gregor Schmid, Dr. Martina Schmid, Karlheinz Kellerer
HRB München 140833