Can I use return value of Action1 in other Action2 - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Can I use return value of Action1 in other Action2 (/Thread-Can-I-use-return-value-of-Action1-in-other-Action2) |
Can I use return value of Action1 in other Action2 - yugal - 12-29-2008 Hi All, I want to use the return value of one action in to other action, please help me. Scenario: Action 1:- I am going to upload the details of a property/(real estate) in a, here the property id entered by the user is unique key, Action 2:- In the Admin section of the site I want to Enable that property in the site for sale, So I want to use the "Action 1" as re-usable action and want to return the "PropertyId" entered by User in "Action 1", So that I can use that perticular "property id" to search in the admin. Many Thanks in advance. Waiting for replies (URGENT!!!) Please find the code snippet in the reply of this thread... RE: Can I use return value of Action1 in other Action2 - yugal - 12-30-2008 Hi Ankur, I have to do this... ' Action1 (Upload Property) Code: SystemUtil.Run "iexplore", "http://MyTestingSite.net" Here I want to use the Property id as the return value for this Action1 so that I can use it in the Action2 to find out the property, and do some task with that property. --------------------------------------------------------------- 'Action2 (Publish Property) Code: RunAction "Copy of UploadProperty", oneIteration Also need to know If I can optimize some qtp script here. RE: Can I use return value of Action1 in other Action2 - nageshpv - 01-02-2009 Hi, try using it as function and get the return value from it and then use it. Else use a global variable and assign value to it in Action 1 and then access the value from Action 2 RE: Can I use return value of Action1 in other Action2 - yugal - 01-02-2009 Hi nageshpv, How can use the script from "action1" as a Function, Can u please explain with an example, I have written the code above for "action1". RE: Can I use return value of Action1 in other Action2 - nageshpv - 01-02-2009 Yugal, try with the Global variable, that will be very simple. RE: Can I use return value of Action1 in other Action2 - sreekanth chilam - 01-02-2009 Hi All, Inorder to use return value of Action1 in other actions like Action2,Action3....Action n in current script. We can use the following features in QTP: 1) User defined Environment Variables (Create User defined Env. Var for return Value.....which inturn can be accessed by all other actions in Current script.) 2) Action Parameters (Output Parameters) 3) Output Values ( Output the required return value(Property Id) into RunTime Global Data Sheet present in Test Results window....which inturn can be accessed by all other actions in the current script) Just try the above from your end & check it out.....I hope you can easily accomplish the required task....... |