SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Member
    Join Date
    Mar 2007
    Posts
    250
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to open a reusable action through script

    Hi All,

    How can I open an action whose path is known through script..I tried the following script but it didnot work

    Dim App
    set App=CreateObject("QuickTest.Application")
    App.Launch
    App.Visible=True
    App.Open(ActionPath)

  2. #2
    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: How to open a reusable action through script

    Action are not seperate entities. They have to be tied to a test and you can only open a test and not a individal action. But if you use Library files to store your code then you can open library files as individual files.

  3. #3
    Member
    Join Date
    Mar 2007
    Posts
    250
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to open a reusable action through script

    thanks tarun.is there any way to go through the code of an action somehow if i know the path where the action is residing.Any particular file where the script written in the action is stored which can b opened thru scripting.

  4. #4
    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: How to open a reusable action through script

    sctipt.mts file in the action folder contains the Action code. But actions are not stored based on Action name but action #

    Action0, Action1 etc...

  5. #5
    Member
    Join Date
    Mar 2007
    Posts
    250
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to open a reusable action through script

    thanks.I have gonne through the file which is located in the action 1 folder and it contains the script.My project requirement is that every test of mine will have only one action be it resuable action or the master script itself which will be calling the reusable actions.Thus will it advisable if I always check the script.mts file using fso contained in the Action 1 folder for a given action because the script.mts file of action 0 folder has got the RunAction command.

  6. #6
    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: How to open a reusable action through script

    Action0 and Action1 will always be there. Action0 defines the complete test flow and from Action1 the actual actions start. Now if you want to execute these using FSO then you need to make sure about few things
    - You should use 100% DP
    - No iteration based on local data table
    - No action parameters.

    And far as this approach is concerned i would suggest you to have a VBS file for each action instead of having a Test. But that all is only possible with 100% DP or shared ORs.

  7. #7
    Member
    Join Date
    Mar 2007
    Posts
    250
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to open a reusable action through script

    well most of my reusable actions have been created already and the automation folder structure is already in place so changing all the actions to functions will require a bit of effort.I want to scan each and every action beacause as per our convention in the project we have declared all the variables required in the actions using the Dim statement in the first1-2 lines.Now I need to generate an excel sheet which will act as an test data template for a particular master script.I have already extracted the values of the variables used in one action from the script.mts and I am creating an excel file dynamically where I will be putting all the variable names as column heading.I plan to do this for all the actions called in a master script by first reading the names of the actions called in the master script thru the script.mts file (as we are having naming coventions finding the path of the called action wont be a problem) and then opening all the script.mts file of the called actions one by one.Moreover I am using shared ORs for the resuable actions.Please suggest if this approach makes some sense.And I am little bit poor on acronyms.Could you please expand DP.Thanks a lot for you response.

  8. #8
    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: How to open a reusable action through script

    DP is Descriptive Programming. Read the article listed in QTP FAQ posts.

  9. #9
    Member
    Join Date
    Mar 2007
    Posts
    250
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to open a reusable action through script

    thanks ,that answers my DP question.I have good idea about DP.Please suggest on my approach as I am building a framework for the first time and I need valuable suggestion from experts

  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: How to open a reusable action through script

    All i can say after reading your post is that it will work but it is something that i would not prefer. There are some basic reasons behind it.
    - Your are using Actions for storing code only and nothing else. Now you can just copy the script.mts in a VBS file and use it the same way
    - QTP does not allow you to edit multiple tests at the same time. So using VBS will allow you to look at multiple file at the same time.

 

 
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 12.50%
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 02:16 AM.

Copyright BetaSoft Inc.