Micro Focus QTP (UFT) Forums
parameters - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: parameters (/Thread-parameters--2573)



parameters - poojaprasanthi1919 - 10-22-2009

- declared a,b,c parameters in action1
a as random variable
b,c are test/action parameters

in test settings i have set default values of b,c as hello,world respectively

in action1 - action properties - parameters - set the values of b,c as pooja,prasanthi resp.

in action1 - action call properties - parameters - set the values of b,c to test/action parameters

Code:
Action1 - expert view - Msgbox("a"),("b"),("c")
Action2 - expert view -
  for i=1 to 3
      Runaction "Action1", oneIteration, RandomNumber("arg_a")
  next

Test result is pass
but

thre random number is generated 3 times then for the subsequent iterations the 3rd random no is repeated
ex : for 5 iterations - 23,67,13,13,13
for 6 iterations - 99,100,21,21,21,21

for b,c
for the first time - action1 is run - takes test/action parameter default values
for the second time when action 2 calls action1 - it is taking action parameters default values.

ex hello,world
pooja,prasanthi
pooja,prasanthi
....


regards pooja


RE: parameters - Saket - 10-22-2009

if you use 'RandomNumber' with a name then it generating new number will depend on the action iteration or test iteration, its is generated once per action/test or once for entire test depend on the configuration setting you. (see more info in QTP help)

I will suggest you to not to use the name in the parameter while using RandomNumber for this case
use start number and end number for the args of function
Code:
for i=1 to 3
Runaction "Action1", oneIteration, RandomNumber(0,100)
next