2019 bis heute  2018  | 2017 2016 2015 2014 | 2013 | 2012

Mailingliste - Einträge 2012

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

Re: [QF-Test] (no subject)

  • Subject: Re: [QF-Test] (no subject)
  • From: Michael Höber, QFS Support <support@?.de>
  • Date: Fri, 27 Apr 2012 08:35:49 +0200



Using QF-Test variables in Jython scripts is not difficult, but there are two viable ways to do so and it is important to understand the difference and which method to apply in which case.

First, standard QF-Test variable expansion takes place before (!) the script is parsed and executed, so you can use $(var) or ${group:name} style variables. In your case "var" is set during (!) the script is executed, but $(var) should get expanded before (!) the script is parsed, thus this won't work as you obviously cannot expand $(var) before setting it. To avoid that kind of problem you should make it a habit to use the run-context's 'lookup' method instead of $(var) (see http://www.qfs.de/qftest/manual/en/tech_scripting.html#sec_api_rc  for API reference).

Let's again stress the difference between the '$' and the rc.lookup methods for accessing variables: '$' expressions are expanded before the script is passed to the Jython interpreter. That means the text "$(var)" in the script is replaced by a verbatim copy of the value of the variable "var". The method rc.lookup however returns the value of "var" during the processing of the script.

For more information please see manual chapter 13.3.3 please:



Best regards,



Get the most out of QF-Test - through training directly from the authors

* via webinar       http://www.qfs.de/en/info/OnlineTraining_QF-Test.pdf

* here at QFS             http://www.qfs.de/en/info/Training_QF-Test.pdf


QFS Support - Michael Hoeber            

Quality First Software GmbH                http://www.qfs.de

Tulpenstr. 41                         Tel: +49 8171 38648-20

DE-82538 Geretsried                   Fax: +49 8171 38648-16

GF: Gregor Schmid, Karlheinz Kellerer     HRB München 140833



From: qftest-list-bounces@?.de [mailto:qftest-list-bounces@?.de] On Behalf Of brahim tarnaoui
Sent: Thursday, April 26, 2012 5:05 PM
To: qftest-list@?.de
Subject: [QF-Test] (no subject)




how to display the var variable??



this is my script:

rc.setLocal("var", "123")




when executing it, i get this error's dialog box in attachments.