2017 up to now  | 2016 | 2015 | 2014 | 2013 | 2012 | 2011 | 2010 | 2009 | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

Mailing List - Entries of 2011

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

Re: [QF-Test] Passing arrays to procedure

  • Subject: Re: [QF-Test] Passing arrays to procedure
  • From: Ivan Boelle <ivan.boelle@?.com>
  • Date: Fri, 18 Feb 2011 10:12:53 +0100
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=gkUItt41uimw8USPxvGvKtX9v7KAPpWJZRBMpoZ/dRU=; b=F8IUf6aQjdfgHgLjdEoKqoaGNCcKJEcLdXJpoX0lWV16RxoRR9o+oEduMrCZ5uNYHs mBHK2q8QQMgfW7qLcRAZJ7oI4McCNYFqMupMnX1uZduob9ma2yo3HvuMrORXw2ToqsVE SFyr7/4UH1nNxZNGsJMLm2sdgN1nctiDpZETU=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=avF1msIMM6+xE/yGkFOEx3Qp5P3Xh2SLHJlmueW5kkDpr9+eJjm7Ka1d+MFs/Xpsi3 k3VfDzbLbTJZCEp2xvPoj8g4o4wNMCdSEIr8wJNKqF28bgTmUiARDGQRauxFG25VvZ8O Q0n6z3T/J0BRzNPCy0/9EjO0oj1maxlxP/v9E=


Thanks for the tip, it will do the trick :)

But my comment was more like a "feature request".
What I would need is to be able to specify a variable as an array and a new "Data-driver" which would be "Array loop".

This would be easier to use rather than introducing scripts everywhere.

Best regards,

Ivan Boelle

INT, Interactive Network Technologies

On Thu, Feb 17, 2011 at 6:31 PM, Robert Lahmer, QFS support <support@?.de> wrote:

Hello Ghada, Ivan

as long as you only need a simple array (with ints and strings) as parameter, you may pass it as a string and parse that string inside the procedure like so:

+Call procedure: WithArrayParam([1, "two", 3, "four"])

+Procedure WithArrayParam
 +Server script: Parse arr
  def createList(arr):
      if arr:
          return eval(arr)
      return []
  values = createList(rc.lookup("arr"))
  for v in values:
      print v

Best regards,

--On Donnerstag, Februar 17, 2011 14:26:19 +0100 Ivan Boelle <ivan.boelle@?.com> wrote:


I would be interested in passing parameters to a procedure as an array
too. And then to be able to iterate on that array.

For example I want to write a procedure which does "n" mouse click at some
given coordinates.
The number of mouse clicks (and coordinates) are variable.

Something like this:

Procedure declaration:
doXClick(xCoordinatesArray, yCoordinateArray)

-> loop ("counter is: " i, "iterate: " $[len($(xCoordinateArray))]
"times") -->MouseClick($[$(xCoordinateArray)[i]],

Procedure call:

call doXClick( xCoordinatesArray = ${0,1,5}, yCoordinatesArray = ${5,2,1})

Ivan Boelle
INT, Interactive Network Technologies

On Wed, Feb 16, 2011 at 2:11 PM, ElSawy, Ghada


How could I pass an array to a procedure and then use this array in a SUT
script inside the procedure??


Ghada El-Sawy

qftest-list mailing list

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 - Robert Lahmer
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