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

Mailing List - Entries of 2012


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

Re: [QF-Test] qftest-list Digest, Vol 92, Issue 19


  • Subject: Re: [QF-Test] qftest-list Digest, Vol 92, Issue 19
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: Fri, 27 Apr 2012 08:54:45 +0200

Hi Raja, Brahim,

double quotes improve the script, but it's still not going to work.

You should keep in mind that $(...) syntax is expanded _before_
execution of the script. So QF-Test will try to evaluate $(var) before
the rc.setVariable.

In scripts, try to avoid $() whenever possible and use rc.lookup instead:

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

Besides the timing, which is the problem in this case, using $(...)
will fail if the variable expands to a multi line string or a string
that contains quotes or other special character. rc.lookup is always
safe to use, except in the case where the expanded string contains
$(...) expressions. If that is the case and you do not want QF-Test to
try to expand those expressions also, use

rc.lookup("var", expand=false)

for Jython or

rc.lookup("var", expand:false)

for Groovy.

Best regards,
    Greg

raja sekhar <rajasb@?.in> writes:

> try with double quotes
>
> 	rc.logError("$(var)")
>
> On 4/27/2012 11:57 AM, qftest-list-request@?.de wrote:
>> Send qftest-list mailing list submissions to
>> 	qftest-list@?.de
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> 	http://www.qfs.de/mailman/listinfo/qftest-list
>> or, via email, send a message with subject or body 'help' to
>> 	qftest-list-request@?.de
>>
>> You can reach the person managing the list at
>> 	qftest-list-owner@?.de
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of qftest-list digest..."
>>
>>
>> Today's Topics:
>>
>>     1. (no subject) (brahim tarnaoui)
>>     2. Re: Internet Explorer - Input File Field (Michael)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Thu, 26 Apr 2012 15:04:49 +0000
>> From: brahim tarnaoui<tarnaoui.b@?.fr>
>> To:<qftest-list@?.de>
>> Subject: [QF-Test] (no subject)
>> Message-ID:<BAY157-W46B5FF35ACCB16A62DEF99ED240@?.gbl>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>>
>> hello,
>> how to display the var variable??
>>
>> this is my script:rc.setLocal("var", "123")rc.logError($(var))
>>
>> when executing it, i get this error's dialog box in attachments.
>>
>> thxBTA

-- 
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                               Tel: +49 8171 38648-0
DE-82538 Geretsried                         Fax: +49 8171 3864816
GF: Gregor Schmid, Karlheinz Kellerer          HRB München 140833