Mailing list - Entries of 2005


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

Re: [qftestJUI] Using a variable from called procedure


  • Subject: Re: [qftestJUI] Using a variable from called procedure
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: Tue, 01 Feb 2005 17:53:02 -0000

Hello Moty,

with qftestJUI versions < 1.8, set x as a global qftestJUI variable.
It doesn't matter if you do that from a script using rc.setGlobal() or
using a "Set variable" node.

With qftestJUI version 1.8 you also have the option to use a Return
node (or throw a ReturnException from a script) to pass the value
directly back to the calling node. The "Call procedure" node now has
an attribute for the name of the variable to bind that value to. Your
suites then look like:

2.qft:

Procecure xyz
  Try
    Check
    Return 1
    Catch ...
      Return 2

1.qft:

Call procedure 1.qft#xyz (Variable for return value = x, local = true)
  If $(x) == 1
    ...
  Else
    ...

Best regards,
    Greg

"Moty Keret" <moty@?.com> writes:

> Hi all,
> I'd like to know how can I build the following structure in qftest:
> - 2.qft file contains this procedure:
>   Try
>     check
>     x=1
> 	catch
>       x=2
>
> - 1.qft file -> Calls to a procedure which is in the 2.qft file.
>   If x=1...
>   else if x=2...
>
>
> I'd like to know how can I assign a value in 2.qft file for x (probably in
> SUT script), and then use its value in 1.qft file.
> Another option might be using throw from the procedure in 2.qft file. But
> then, how can I use the 'If' to check the thrown value.
>
>
> Thank you,
> Moty

--
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876


Videos Downloads Documentation Buy Free Trial