SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Jul 2005
    Location
    banglore
    Posts
    104
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Whether to use Reusable action or Function?

    Hi,
    I had a dbt..Which is the best practice..to create a function or a reusable action?..anyhow in function u cannot include checkpoint and u have to do descriptive programming..Wht is the advantage of using Function over reusabel action..If possible explain with a scenario..
    Thanks in advance..Thilak

  2. #2
    Senior Member
    Join Date
    Oct 2003
    Location
    Atlanta
    Posts
    176
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Whether to use Reusable action or Function?

    Function has much more advantage on most of the scenarios
    1. faster
    2. access specifier
    3. can pass 'n' no. of parameters
    Cheers,
    Prasanna -

  3. #3
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Whether to use Reusable action or Function?

    Paul just for clarification purposes, you don't have to use DP in a function (although most functions you see are mainly VBScrips/WSH code), you can place QTP recorded code ina function.

    Mark Smith.

  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: Whether to use Reusable action or Function?

    Well it depends on the scenario that you have in front. Function are basically made when you think there will reusability across other scripts. Example would be function related to string where you want string between two specified characters. Then you can make functions in your script to make the script more readable. Example

    OpenXL
    ReadXL
    CloseXL

    But the only thing is that function have to be used with action. Otherwise you will loose the advantage of the OR that QTP provides. Again no body can say which one is better but given a scenario you can choose which one is a better option.

  5. #5
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Whether to use Reusable action or Function?

    Perhaps we should have a poll whether people prefer Functions or Reusable Actions, no pro's or con's just peoples preferences:

    I'll start - 100% Functions.

    Mark Smith.

  6. #6
    Advanced Member tonymro's Avatar
    Join Date
    Jul 1999
    Location
    Deep in the Coast Range Mountains of Oregon, USA
    Posts
    562
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Whether to use Reusable action or Function?

    As I see the OR and checkpoints to be liabilities instead of advantages, we use external reusable functions as much as possible.

    We use reusable actions to contain code for AUT function-specific test scripts organized as follows:
    1.) declarations of local constants specific to the test script
    2.) declarations of local variables specific to test script
    3.) code for test script entry handler. In most cases, handlers call functions in external libraries.
    4.) any local functions used by test cases in the test script
    5.) code for test cases in test script. In most cases, test cases are calling functions in external libraries.
    6.) code for test script exit handler

    Our QTP projects reference external libraries organized into generic and AUT-specific function library files. Global constants and variables are defined in AUT-specific library files.

    We use library functions and formatted worksheets in the data table in place of checkpoints. We have implemented something similar to the XML-based DP object repository, except our object references are stored in a specially formatted worksheet in the data table.

    [ 12-06-2005, 10:32 AM: Message edited by: tonymro ]
    Sr. Software Test Automation Architect

  7. #7
    Senior Member
    Join Date
    Jul 2005
    Location
    banglore
    Posts
    104
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Whether to use Reusable action or Function?

    Hi Mark, If we place recorded script inside a function..It is scenario or application specific..As Functions are reusable components it should be generic..so tht we can call tht function to any scenarios..Sorry if i am wrong..
    Anyhow thx all for the replies
    Thilak

 

 

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 10.71%
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 06:57 PM.

Copyright BetaSoft Inc.