Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use an Array in an Action declared in another Action
#5
Solved: 11 Years, 2 Months ago
Hi Prabhat,

I would suggest you to go with "Dictionary Objects" to solve this requirement.

I had tried this on QTP 9.5V & its working fine for me.

Please follow the below steps:

In Action1:
Step1: Create the required array
Step2: Store all the Array values into Dictionary Object items(Variables)

In Action2:
Step3: Store all the Dictionary Items values into an Array variable
Step4: Loop thru the Array using Lbound,Ubound and access the array values in Action2

For more info. refer the code given below:

Code in Action1:
Code:
d=Array("London","Boston","Newyork","Sanfransisco")        
For i=0 to ubound(d)
   GlobalDictionary.Item("Name"&i)=d(i)            
Next

Code in Action2:
Code:
x=GlobalDictionary.items
   For j=0 to ubound(x)
     msgbox x(j)
  Next

Implement accordingly as per your requirement.

Hope this would solve your problem Smile
Reply


Messages In This Thread
RE: How to use an Array in an Action declared in another Action - by sreekanth chilam - 06-07-2010, 02:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Action Parameterization Issue Slothman 1 1,872 10-31-2020, 01:05 PM
Last Post: Ankur
  no action on click for particular wpf button jlavrecka 1 1,352 05-21-2020, 11:33 PM
Last Post: jlavrecka
  Object not found during the 2nd iteration of an Action call in a For loop BGunay 0 942 04-23-2020, 07:08 PM
Last Post: BGunay
  UFT 14.01 - identifying wpf objects. but not performing action. chinmoyee 1 2,439 11-15-2017, 03:42 PM
Last Post: Ankur
  Default state of new action aparajita 1 2,306 08-25-2015, 12:11 AM
Last Post: aparajita

Forum Jump:


Users browsing this thread: 2 Guest(s)