Micro Focus QTP (UFT) Forums
Can we have the value of variable for one to another - 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: Can we have the value of variable for one to another (/Thread-Can-we-have-the-value-of-variable-for-one-to-another)



Can we have the value of variable for one to another - anbarasu - 09-30-2009

Hi,
Let say there are two actions, in action i we have a varible a and i m calling action2 from action1; how can i use the current value of a (which is in action1) in action 2.


RE: Can we have the value of variable for one to another - Saket - 09-30-2009

the best way to use the variables across actions is by using input parameters.
define an Input parameter in action2 and while calling the action in action1 pass the variable a as the input parameter to action2.

the other way would be declare a public variable in a library file, associate this with both the actions and then you can use the variable in other action.


RE: Can we have the value of variable for one to another - basanth27 - 09-30-2009

You can define Environment Variables in the Test settings or load dynamically using XML or ini file.

Passing the values you can use it in the format
Environment.value("VariableName") = Value.