SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Senior Member
    Join Date
    Sep 2005
    Location
    India
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Issue Regarding Passing Value between actions.

    I have Three Action MainAction , Action1 , Action2.
    The Action2 will used a value returned by the Action1.
    The Action 1 and Action 2 are called by MainAction


    In Action1 i defined output parameter OutTxt and assigning its value in action1 at run time using
    Parameter("OutTxt") = "Test Txt"

    In MainAction i m using following lines to call the actions

    OutTxtMain = RunAction ("Action1", oneIteration)
    msgbox "return ="&OutTxtMain
    RunAction "Action2", oneIteration , OutTxtMain

    The Issue is that i m not getting any value in OutTxtMain.
    in MainAction

    Pls do the needful if any one of u is having idea.
    Thanks & Regards
    Shubhra

  2. #2
    Member
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    73
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Issue Regarding Passing Value between actions.

    you need to use ExitAction to pass back the value if you want to use

    OutTxtMain = RunAction ("Action1", oneIteration)

    although how it is you could use

    RunAction "Action1", oneIteration, "OutTxt", OutTxtMain

    however, if you're going to be running this through LoadRunner you'll need to use the globalsheet in the datatable to store the value as QTP under LR doesn't support either ExitAction or parameters

    hope this helps

    Jim

  3. #3
    Senior Member
    Join Date
    Sep 2005
    Location
    India
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Issue Regarding Passing Value between actions.

    Even if i used ExitAction then also i m not getting the value of the OutTxt Output action parameter.
    Thanks & Regards
    Shubhra

  4. #4
    Junior Member
    Join Date
    Mar 2006
    Location
    India
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Issue Regarding Passing Value between actions.

    Try this...

    Here is the code for passing the output value of one Action to other as an Action Parameter.

    Action1:

    Dim var1
    var1 = Cint(40)

    RunAction "Action2", oneIteration, var1


    Go to Step for Action2 and add input variable as var1 in the Action Properties
    ( Step --> Action Properties)


    Action2:

    var2 = Parameter("var1")
    Msgbox var2


    I hope this will work now.

    Regards,
    Angelin.

  5. #5
    Senior Member
    Join Date
    Sep 2005
    Location
    India
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Issue Regarding Passing Value between actions.

    Yes

    It will work if u r using nested action.
    I have Three action.

    Action1
    Action2
    Action3

    I m calling Action2 and Action3 from Action1
    The Action2 will return value using Action Out Parameter and it is used by the Action3.

    I the Above eg u r not returning any value from the action.
    Thanks & Regards
    Shubhra

  6. #6
    Member
    Join Date
    Oct 2002
    Location
    NJ, USA
    Posts
    65
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Issue Regarding Passing Value between actions.

    If you want to use the syntax in the MainAction:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">retVal = RunAction(&quot;Action1&quot;, oneIteration, inputparam)</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">then, you must use the ExitAction("return value"). In this case, you do not have to define an output parameter for the "Action1", just one input parameter for the value that you are passing.

    If you want to use the Input Parameters/Output Parameters in the Action properties to receive and return values, then your statement in MainAction should be:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">RunAction &quot;Action1&quot;, oneIteration, inparavalue, outparamvalue</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">And in the "Action1" , you should use the following statement to return value to the MainAction:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Parameter(&quot;OutParamDefinedByYouIn ActionProperties&quot = ReturnValue</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

  7. #7
    Senior Member
    Join Date
    Sep 2005
    Location
    India
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Issue Regarding Passing Value between actions.

    Action1 Content
    Out = RunAction ("Action2", oneIteration)
    Msgbox Out

    Action2 Content
    'The OutTxt is defined as the OutTxt Parameter in Action2

    Parameter("OutTxt") = "The Out Put Value from the Action2"
    ExitAction

    I m getting error in Action1 (msgbox Out) type mismatch.

    If i used following code for action1
    Action1 Content
    Out = RunAction ("Action2", oneIteration)
    DataTable("A" , dtGlobalSheet) = Out
    Msgbox DataTable("A" , dtGlobalSheet)
    Then i m not getting any error but in the messgbox no any value is coming.

    Help me if any one of u is having idea.
    Thanks & Regards
    Shubhra

  8. #8
    Member
    Join Date
    Sep 2004
    Location
    India
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Issue Regarding Passing Value between actions.

    How about storing the output into the datasheet, or in an environment or in a global variable.

    That would seem the simplest solutions, unless you have a reason for not using it.

    Here's an example using 3 actions: Main, Action1, Action2.

    Action 1 has an input parameter "in1" and an output parameter "out1". Action2 has an input parameter "in2"

    Main Content
    RunAction "Action1", oneIteration, "5", outputval
    RunAction "Action2", oneIteration, outputval


    Action1 Content
    parameter("out1") = parameter("in1") + 1

    Action2 Content
    msgbox(parameter("in2"))

    [ 04-02-2006, 10:44 PM: Message edited by: jugular bean ]

  9. #9
    Senior Member
    Join Date
    Sep 2005
    Location
    India
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Issue Regarding Passing Value between actions.

    Hi Jugular bean

    Thx for solution but i want to the out1 returned by action1 in action 2.in above example u are not storing output value from action1 any where.
    Then how u can pass the out1 modified by actio1 to action2.
    Thanks & Regards
    Shubhra

  10. #10
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Issue Regarding Passing Value between actions.

    Originally posted by Shubh14:

    In Action1 i defined output parameter OutTxt and assigning its value in action1 at run time using
    Parameter("OutTxt") = "Test Txt"

    In MainAction i m using following lines to call the actions

    OutTxtMain = RunAction ("Action1", oneIteration)
    msgbox "return ="&OutTxtMain
    RunAction "Action2", oneIteration , OutTxtMain
    <font size="2" face="Verdana, Arial, Helvetica">You will never get the value this way. There is difference between ActionReturn Value and Output parameter value. What you are doing is that you are assigning the value to a output parameter and then you are expecting it to come in the return value.

    When you use ExitAction ("I wanna exit") then this is the value returned by the action. And if you want to use the output parameter then you need to add that particular parameter to that action. So if you want to add a output parameter to Action1 then open that action and got Step-&gt;Action Properties... menu and there you can add the parameter.

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Dim OutTxtMain
    RunAction &quot;Action1&quot;, oneIteration, OutTxtMain
    RunAction &quot;Action2&quot;, oneIteration , OutTxtMain</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Note: OutTxtMain should be an output parameter in Action1 and an input parameter for Action2.

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 9.38%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:35 AM.

Copyright BetaSoft Inc.