Micro Focus QTP (UFT) Forums
How to pass the value from one reusable action to another reusable action? - 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: How to pass the value from one reusable action to another reusable action? (/Thread-How-to-pass-the-value-from-one-reusable-action-to-another-reusable-action)



How to pass the value from one reusable action to another reusable action? - Uma - 10-05-2011

Hi,
I am having 3 Reusable Actions,
1.login 2.Function 3.Logout.
In the login Action I am getting My Platform Value thru input box,According to that Platform value I need to open the Excel sheet in Function Action.
How to Pass the value from one Action to Anothor.
Login Action
I set the input parameter thru Action properties and
Code:
Sysenv=Inputbox("Enter sysen"v)
i = Sysenv
RunAction "functions", oneIteration,i

and in FunctionAction

se = Parameter("i")
msgbox se
But it gives error.
Any help?
Thanks,
Uma


RE: How to pass the value from one reusable action to another reusable action? - anil2u - 10-05-2011

Hi Uma,

1) You cannot Pass parameter to Function action when you are calling it from Login action as the parameter can be sent only after the completion of Login action.

2) Try to call Login, Function & Logout in a single Master script.
In 'Login' action
Go to Edit -> Action -> Action Properties -> Parameters - Declare your output parameter "i" here and then in your code assign value
Parameter("i")=sysenv

Now in 'Function' Action Go to Edit -> Action -> Action Properties -> Parameters - Declare an input parameter with some name say 'env' and then in your code assign value
env1=Parameter("env")

3) Declare your actions like this in Master script:
RunAction "Login", oneIteration,val1
RunAction "functions", oneIteration,val1 (Note this should be the same variable which you are returning in the above action i.e. Login)

Hope this would help



RE: How to pass the value from one reusable action to another reusable action? - Uma - 10-07-2011

Hi Anil,
You are correct,I used input and output parameter and I have main Action to describe all the RUN Action..and it is working.
we can call the parameter to function,I used this too
RunAction ActionName, IterationQuantity, Parameters
Thank you somuch for the help.
Uma