Results 1 to 15 of 15

Thread: Get information about reusable actions used in a test

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Answers
    23

    Unhappy Get information about reusable actions used in a test

    Hi ,
    I have a test which contains no. of reusable actions in it. I'm calling them using RunAction statement. How I could find out the actions used in the test in the manner they are called through RunAction statements?
    I know we can find which actions are used for test , but can we find the sequence in which the reusable actions are called?
    For Eg:
    Suppose I have a Test "A" which contains reusable actions "B" , "C" , "D" , "E".
    suppose "B" has 2 Input parameters & 1 output parameters
    suppose "C" has 1 Input parameters & 1 output parameters
    suppose "D" has 1 Input parameters & 2 output parameters
    suppose "E" has 0 Input parameters & 1 output parameters

    Now I called them in my test as
    RunAction "B" , oneIteration , BIP1 , BIP2 , BOP1
    RunAction "C" , oneIteration , CIP1 , COP2
    RunAction "E" , oneIteration , EOP1
    RunAction "D" , oneIteration , DIP1 , DOP1 , DOP2
    RunAction "B" , oneIteration , BIP3 , BIP4 , BOP2
    RunAction "D" , oneIteration , DIP2 , DOP3 , DOP4
    RunAction "C" , oneIteration , CIP2 , COP2
    RunAction "B" , oneIteration , BIP5 , BIP6 , BOP3
    ....Now I want to find how actions "B","C","D","E" are called & with what parameters?
    Means I'm expecting in this format
    "B"
    Input Parameters :
    1 = BIP1
    2 = BIP2
    Output Parameters :
    1 = BOP1
    "C"
    Input Parameters :
    1 = CIP1
    Output Parameters :
    1 = COP2
    "E"
    Output Parameters :
    1 = EOP1
    "D"
    Input Parameters :
    1 = DIP1
    Output Parameters :
    1 = DOP1
    2 = DOP2
    "B" , BIP3 , BIP4 , BOP2
    Input Parameters :
    1 = BIP3
    2 = BIP4
    Output Parameters :
    1 = BOP2
    "D"
    Input Parameters :
    1 = DIP2
    Output Parameters :
    1 = DOP3
    2 = DOP4
    "C"
    Input Parameters :
    1 = CIP2
    Output Parameters :
    1 = COP2
    "B"
    Input Parameters :
    1 = BIP5
    2 = BIP6
    Output Parameters :
    1 = BOP3


  2. #2

    Re: Get information about reusable actions used in a test

    I really got confused after reading what you have got here. Sorry.

    I would suggest you to use Reporter utility ( after each Action. You can also use a Pop-up message after each action that will display for a few seconds so you know where in the step you are.


  3. #3
    Junior Member
    Join Date
    Feb 2008
    Answers
    12

    Information about reusable actions used in a test

    Need to call one reusable external action and Get the output value from the external reusable action. Need to Use this output value in the calling action. How can I do this?
    For example Random Function in external Action and it function return a random string “XXXXX” and I want to use this random string for next operation in the calling action Action2. How can I do this?
    Debug this code also returnValue=RunAction(“Action name”, iteration, input parameter)
    After debugging above code , get Null value


  4. #4
    Junior Member
    Join Date
    Nov 2007
    Answers
    23

    Thumbs up Re: Get information about reusable actions used in a test

    Hi,
    Simply write statement as
    RunAction “Action name”, iteration, input parameter ,OPVar
    You will get the output value in OPVar variable for further use.

    Regards,
    Manoj


  5. #5
    Junior Member
    Join Date
    Feb 2008
    Answers
    12

    Re: Get information about reusable actions used in a test

    Hi,
    tried this method also, while debugging script null value return in outvale


  6. #6
    Junior Member
    Join Date
    Nov 2007
    Answers
    23

    Re: Get information about reusable actions used in a test

    Let me know how you are assigning this value to output parameter in your reusable action....

    You must use it like
    Parameter("OPVar1") = SomeValue.

    in your reusable action.


  7. #7

    Re: Get information about reusable actions used in a test

    Please do not hijack other members' threads. I am not sure what is happening here.

    Manabh, did you figure out how to handle the Reusable action situation you discussed in the original post?


  8. #8
    Junior Member
    Join Date
    Nov 2007
    Answers
    23

    Unhappy Re: Get information about reusable actions used in a test

    Hi Anshoo,
    Thanks to all the responses. But my problem was a bit different. I wanted to extract the details of runactions that I have used in my test. I hope you can understand. The details contains Name of the re-usable action,List of input parameters,List of output parameters. And that too without running the test. See I wanted to figure out the dependencies in my test of re-usable actions.For this purpose I want that details. My logic is simple If any out parameter of a re-usable action is used as in parameter for another re-usable action then the second re-usable action is dependent on the first re-usable action & so on. I wanted it through any third party tool like VB/VBScript where I can declare QTP's programmable objects, like we used to do as for QTResult,QTApplication,etc. I know after running the test I can get this details ,but how can I get them just by reading the test file?


  9. #9
    Junior Member
    Join Date
    Feb 2008
    Answers
    12

    Re: Get information about reusable actions used in a test

    Hi manabh,

    actual scenario is as follows:

    strrndval="sc" 'initialize value name

    runaction "createrandomstring", oneiteration,strrndval,strcommname ( acc. To ur suggestion)
    Broswer("name:=test").webedit("name:=commname").set strcommname
    when i debug this,,
    qtp show's empty value for "strcommname"

    Last edited by monikasangwan; 02-27-2008 at 02:19 AM.

  10. #10
    Junior Member
    Join Date
    Nov 2007
    Answers
    23

    Question Re: Get information about reusable actions used in a test

    Hi,
    Actually I'm interested in what you are doing in the re-usable action. ie. how you are assigning the output parameter.


  11. #11
    Junior Member
    Join Date
    Feb 2008
    Answers
    12

    Re: Get information about reusable actions used in a test

    One Function in the reusable action which returns the string and in the calling action I need to use that string.

    Function CommName(strCom)
    --
    ---
    ---
    CommName=strCom
    End Function

    Wann use the return value of the Function in the another action


  12. #12
    Junior Member
    Join Date
    Nov 2007
    Answers
    23

    Re: Get information about reusable actions used in a test

    Still you haven't clearly mentioned what you are assigning to the output parameter......


  13. #13
    Junior Member
    Join Date
    Feb 2008
    Answers
    12

    Re: Get information about reusable actions used in a test

    In the output parameter, Assiging the Function return value with the Function name and that function take input from the Calling function


  14. #14
    Junior Member
    Join Date
    Nov 2007
    Answers
    23

    Arrow Re: Get information about reusable actions used in a test

    Still i'm not clear.... But the ideal scenario should be like this
    'your calling action code
    code start***********************
    runaction "pickrandomvalue",oneiteration,ip1,op1
    code end***********************

    'your re-usable action code
    code start***********************
    varx = chooserandom(parameter("ip1"))
    parameter("op") = varx

    'as per your code
    function chooserandom(someval)
    .................
    .................
    Chooserandom = xval
    end function
    code end***********************

    Last edited by manabh; 02-27-2008 at 02:47 AM.

  15. #15
    Junior Member
    Join Date
    Feb 2008
    Answers
    12

    Re: Get information about reusable actions used in a test

    Pls check this:
    reusable action:
    code:-----
    function commname(strcom)
    ------
    ----
    ---------
    strcom=rnd(----)
    -------
    -------
    commname=strcom 'function return value
    ----
    end function


    calling action
    code start:-------
    ------
    ---- ---
    ------- ----
    runaction "reusableaction[reusableaction]",inputpar,outputpar
    Broswer("name:=test").Page("title:=test").Webedit("name:=commname").set outputpar
    ---------
    ---------
    Code end

    Last edited by monikasangwan; 02-27-2008 at 03:01 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact