SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Aug 2002
    Posts
    253
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Reusable actions in LR?

    I'm in the process of trying to build out our department's load testing suite and make things a little more flexible and robust.

    In so doing, I'm beginning to build a little library called "utils.c".

    I'd like this utils.c file to be accessible from any script, so I've obviously got to add file to script, include the utils.c file in globals.h, create prototypes for all functions, etc so the file can be uploaded to performance center.

    My question is that when I update the utils.c code, I'm going to need to delete and re-add it to every file that references utils.c to get the newest code, because of the way Performance Center saves files (at least I think this is how itd have to work). This will be at least mildly painful, if not extremely annoying.

    So how do you guys get past this? In QTP there is a "reusable action", but I found no such thing in the Loadrunner literature. I had to create a VTS for global variables, so is there a similar system for shared functions?

    Your insights would be appreciated.

    Thanks,

    -- Dan

  2. #2
    Moderator
    Join Date
    Aug 2001
    Location
    NC
    Posts
    6,018
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Reusable actions in LR?

    There are a number of ways to handle this actually. Some more painful than others.

    Method one. Include a <insert your name here>.h file on all of the load generators and development computers in the LoadRunner\include directory. manually reference the appropriate include files in your scripts and then include your functions where appropriate.

    Method two. Include your .h file on all of your load generators and development computers in the LoadRunner\include directory. Modify your standard templates for VUGEN to automatically reference your include file.

    Method three. Include your .h file and all associated references as part of the standard protocol template. Your .h file becomes an extrafile for distribution to each of the load generators.

    Method four. Build a custom template. It's no longer web, but Corydaj_web that you use for development. This template includes all of your custom .c files, actions pre defined and scheduled, pre-set run time settings, headers, etc... Anything extra is predefiend to be sent to to Load generators automatically.

    There are probably a couple of other methods, but these are the ones that come to mind.
    James Pulley

    Replace ineffective offshore contracts, LoadRunnerByTheHour. Starting @ $19.95/hr USD.

    Put us to the test, skilled expertise is less expensive than you might imagine.

    Twitter: @LoadRunnerBTH @PerfBytes

  3. #3
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    Location
    St. Louis - Year 2025
    Posts
    15,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reusable actions in LR?

    I use a system ("xcopy..."); call in init to grab the latest.

    "Methods by James" ... those sound as workable and represent a lesser chance of failure than my own.

  4. #4
    Member
    Join Date
    Aug 2002
    Posts
    253
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reusable actions in LR?

    I'm really surprised Mercury doesn't have support for stuff like this... no global variables, no global functions... am I over-architecting my load scripts or what? You two seem to have tons of experience, aren't these types of activities the foundation on which flexible load scripts can be written?

    Also, thank you both for your responses. James, I looked up your third and fourth answers and didn't find much on templates... I don't know if I've seen them in Vugen / Vugen help either. Do you know where I could find more info on the topic of templates?

    Jake, xcopy seems like a great idea... I threw a quick script together and it worked fine. One thing I notice is that xcopy doesn't seem to return a failure (despite what the documentation says) upon error (file not found, for ex). Have you noticed this?

    -- Dan

  5. #5
    Moderator
    Join Date
    Aug 2001
    Location
    NC
    Posts
    6,018
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Reusable actions in LR?

    LoadRunner Templates....boy I could write a book on that....only Mercury would not allow it to be published. I sure hope the new HP/Mercury adopts HP's terms on publishing and custom training creation.

    Whenever you hit file\new in VUGEN, what you are looking at are development templates referring to a certain subset of base files, referenced header files, etc... Creating these is a dark art. Call Mercury and ask a question on them and you are likely to get lots of dead air and a callback in a couple of days with a "suggestion." And, depending upon your version of LoadRunner there may be two-three ways to build a custom design template. Barring external consulting, do a string search in the Mercury directory for of the the virtual user tags that you have not used. That will likely point you to the directory containing all of the source files for you to construct a new template. You should be able to engineer a solution based upon the examples presented.
    James Pulley

    Replace ineffective offshore contracts, LoadRunnerByTheHour. Starting @ $19.95/hr USD.

    Put us to the test, skilled expertise is less expensive than you might imagine.

    Twitter: @LoadRunnerBTH @PerfBytes

  6. #6
    Moderator
    Join Date
    Jan 2006
    Location
    Charlotte, NC
    Posts
    1,600
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    coreydaj - xcopy error

    If you are using Jakes' 'system("xcopy...', and are trying to hook an error from the system command it is going to fail. Regardless of the success of failure of the xcopy command the system command is going to succeed. If this is critical to you, you are going to have to redirect the output of xcopy to a file and parse that. (At that point you are going to have to be very worried about contention issues for that file.)
    Unless you are writing a compiler, strtok is NOT the answer.
    See: http://www.sqaforums.com/showflat.ph...=541641#542222

    QAF is still an exercise in self-sufficiency! (Thank JB!)

 

 

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 12:15 AM.

Copyright BetaSoft Inc.