LoadRunner Script Runtime Settings

When running a training or mentoring session, people often ask what runtime settings they should use; as if there is a magical list of settings that will always be correct for any testing situation. Obviously you select runtime settings that are appropriate for what you are trying to achieve with your test, but the funny thing is that there are actually a small list of settings that are usually appropriate for most situations. Read on…

General: Run Logic

Whenever I am using a vuser type that allows multiple actions in a single script, I will create a separate action for each business process and put appropriate percentage weightings on each action. It is very unusual to have to do anything more complicated than this. I don’t usually use the “sequential” option or create blocks unless I need to have fractional percentage weightings for a business process - percentages must be integer values, so to run a business process 0.1% of the time you could create a block that runs 1% of the time, and put an action in the block that runs 10% of the time.

It’s also rare to set a script in a scenario to run for a specified number of iterations (mostly done by time or set to run indefinitely). Generally “number of iterations” is only used when running the script in VuGen.

General: Pacing

  • “As soon as the previous iteration ends” is used when running in VuGen or when loading/verifying data. Do not use this for load testing
  • I have never seen the point of the “After the previous iteration ends” option. Why would you want to run an unknown number of transactions per hour against the system?
  • Don’t use the “At fixed intervals”. If something causes your users to become “in step”, they will tend to stay that way and continue to all hit the server at the same time.
  • “At random intervals” is definitely the way to go. Obviously for your users to create a certain number of orders per hour the iteration time must average to 3600/num iterations in an hour. Do not make the lower boundary value any bigger than the maximum time it takes to complete the business process, or you will end up creating less transactions per hour than you intend to.

General: Log

  • Logging creates additional overhead on your load generators, and can create huge log files.
  • I log absolutely everything when debugging in VuGen.
  • When running the script as part of a scenario, I leave extended logging on but change the logging to “Send messages only when an error occurs”. This gives a little more information than turning logging off entirely, and won’t create any additional overhead while everything is running smoothly (and if the system is not running smoothly you are going to need to stop the test and investigate anyway).

General: Think Time

  • Just like the pacing setting, I think that it is a good idea to put some randomness in your think times.
  • I use a random percentage of 50-150% of recorded think times.
  • Use “Ignore think time” if you are debugging in VuGen or if you are loading/verifying data.

General: Additional Attributes

  • This option is ignored by most people. It is used to create a parameter with a given value without having to edit the script (as runtime settings can be overridden in the Controller).
  • In the screenshot I have created a parameter of ServerName with the address of the test envioronment. If you were testing in more than one test environment at a time, this would make save some time.

General: Miscellaneous

  • Continue on error is generally only going to be used if you have written code to do something when you encounter an error. Usually the default behaviour of ending the current iteration and then starting the next one is sufficient). I don’t advise anyone to try to write a script that handles errors in the same way as a real user because it will create a lot of additional work for very little benefit, but doing something simple like writing some useful information to the logs and then calling lr_exit(LR_EXIT_ACTION_AND_CONTINUE , LR_FAIL) can be useful.
  • “Fail open transactions on lr_error_message” should always be ticked. If you are raising an error, you should fail the transaction step that you are performing.
  • “Generate snapshot on error” is useful. If it is a web script, any error messages should be added to your content check rules.
  • Run your virtual user as a thread unless you have code that is not threadsafe or there is some other reason to run your virtual users as a process. The overall memory footprint on your load generators will be higher if you run as a process.
  • I never use the “Define each action as a transaction” option. If I want a transaction in my script I will add it myself with lr_start_transaction.
  • I never use “Define each step as a transaction” either. If it is a web script, I can use the transaction breakdown graph to get this information, otherwise I will add the transactions myself.

Network: Speed Simulation

  • Not all vuser types have this option available.
  • Most of the time my virtual users will use the maximum bandwidth.
  • If I want to emulate users with bandwidth constraints, I will do this in a separate scenario.
  • Google calculator is handy to calculate bitrates if your bitrate is not available from the drop-down list e.g./ “256 Kbps in bps

All of the following settings only apply to web-based scripts. Each vuser type will have its own runtime setting options. It is important to know what they mean and how they will influence your test results before running any tests that you plan to report on.

Browser: Browser Emulation

  • Some people get confused by the User-Agent (browser to be emulated) setting. If 90% of your users use Internet Explorer 6.0 and the rest use Firefox 1.5, you don’t have to change the runtime settings for your users to match this. All it changes is the string that is sent in the “User-Agent” field of your HTTP requests. This is completely pointless unless your application has been written to serve different content to different browsers based on the User-Agent field.
  • TODO

Internet Protocol: Proxy

  • Generally people won’t be using your web applications through your proxy server, so it shouldn’t be part of your test either.
  • If you start getting errors that are due a proxy server rather than the system under test, it will just confuse the people who have to fix the problem.
  • A proxy server will also make IP-based load balancing ineffective.
  • If it’s an intranet application and everyone will be using the application through the company’s proxy, then the proxy server should be explicity declared to be in scope for your load test. You should make sure that you have an identical proxy server for your test environment, or that you have permission to be generating load on a piece of Production infrastructure.

Internet Protocol: Preferences

  • TODO

Internet Protocol: Preverences - Options

  • These settings are default values specified by Mercury, rather than being inherited from the web browser that is installed on your workstation. Generally you will not need to change them, but be aware that they are here.

Internet Protocol: Download Filters

  • Download filters are a quick way of preventing your scripts from downloading content from certain URLs or hosts/domains.
  • I generally use this feature when the web application in the test environment contains third-party images used for tracking website usage (e.g. images from Webtrends or Red Sheriff etc).
  • I think it is better to specify which hosts your script is allowed connect to, rather than which hosts your script can’t connect to (because it’s easy to miss one accidentally, or the application may change and refer to a new third-party domain).
  • Use web_add_auto_filter if you want to specify this in your script rather than your runtime settings.

Internet Protocol: ContentCheck

  • I have talked about Content Check rules before; I think that if you aren’t using them already, then you are not getting the most out of the LoadRunner feature-set.
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

26 Responses to “LoadRunner Script Runtime Settings”

  1. Kunal Says:

    Hi,

    This update was useful as it helped me understand certain run-time features which I wasnt using so far. Thanks!
    I have one doubt regarding one run-time setting that you have mentioned. Under the Logs - > Extended Logs, you have selected all the three options, dont you think for a test with longer duration (running into hours) and for large number of users this could be an issue as this would in-turn generate lot of data which might not be actually required?

    Thanks,
    KK

  2. Stuart Moncrieff Says:

    Thanks for the comment Kunal, I have updated the text under the screenshot to explain my recommendation (it only logs when there is an error - you shouldn’t be getting a large number of errors).

    Cheers,
    Stuart.

  3. Chris Meisenzahl Says:

    Fantastic post! I was aware of most of this, but I still managed to pull a few gems from here. Thanks!

    Chris
    http://amateureconblog.blogspot.com/

  4. Jay Harris Says:

    “Whenever I am using a vuser type that allows multiple actions in a single script, I will create a separate action for each business process and put appropriate percentage weightings on each action.”

    I have been advocating this for years. As we consult for new clients, and help them improve their performance testing processes, this is one of the items that I advocate under performance testing. I usually find they create one script for each click-path or BP, and these dozens of scripts at the same time, or worse, one at a time. Using a single script with action-weighting helps force the tester to get a thorough load on his system, simplifies increasing user load (you only need to increase VUsers on one script, not 30), and simplifies test management.

    I think this item is worth post all on its own.

    Overall, excellent post. This needs to be a Top Page.

    Nice work.

  5. Deepanshu Says:

    Hi,

    Is there any way to record Window download box in Loadrunner 8.1?

    I tried many things butno luck,it seems that its not recording that download dialog box.

    When I click on “export” tab, download dialog comes with 3 option:
    1. Open
    2. Save
    3. Cancel

    I’m choosing Save but nothing getting recorded in Loadrunner.

    Please help.

  6. Yury Says:

    Camcorder is a better tool to record a dialog box in LoadRunner.

  7. Abhijeet Says:

    Its really useful, especially the Content check rule is a good idea to implement.

  8. bart Says:

    Great post, but I have an unrelated question. When purchasing a load testing software package, how do you decide what number of vusers you should get a license for? Is there some rule of thumb I should use to calculate this number? Our highest volume app is a student portal, with a max of 10000 successful user logins with in an hour. Our total student population is 50-60K. Based on these numbers can you determine a good number of vusers we should purchase. I know that 500 vusers can translate to more than 500 “real users”. Any help would be greatly appreciated.

  9. Prashanth Says:

    Hi,
    Have few questions regarding Network Buffor Size.

    1. What constitutes a Network Buffer Size?
    2. Is it a buffer on NIC card or RAM?
    3. What dictates the Network Buffer Size?
    4. For a best practise, how will we know what the size should be, before test execution?

    Any help would be greatly appreciated.

    Regards,
    Prashanth

  10. Hs Says:

    Great reference for people that requires a knowledge of Runtime Settings! :)

    My website to complement:
    http://loadrunnertnt.blogspot.com

    Regards
    Hs

  11. Ben Simo Says:

    Is there any way to record Window download box in Loadrunner 8.1?

    LoadRunner (Web HTTP protocol) records the HTTP traffic between the client and server. It does not record GUI actions. The download box is a GUI feature of IE and selecting the save or open options have no impact on the client-server communication. This means that you cannot record the download box and it has no impact on a recorded load test script.

    Ben Simo
    http://QualityFrog.com

  12. Anish Says:

    hi,

    I want known that which Language is use for LoadRunner.And How knownlage required for that Language.

    Anish

  13. avis Says:

    Hello,
    I am trying to simulate a realtime scenario where I need to open multiple browsers using different users in the same script.
    Is it possible using loadrunner?
    thanks
    Avis

  14. sugumaran Says:

    Hi!
    IE7+loadrunner 8.1

    failed to create snapshot, why? what could be the reason? is there any settings available to activate?

    sugu

  15. Vivek Says:

    I want to know about the parameterisation of the load runner script.in detail

  16. Vivek Says:

    Parameterization in load runner

  17. satish Says:

    Hi, can u tell me how to run QTP sripts from Loadrunner, and for doing this what r the things one need to takecare.

  18. satish Says:

    Hi, can u tell me how to run QTP sripts from Loadrunner, and for doing this what r the things one need to takecare.

  19. satish Says:

    Hi
    1. How to run QTP scripts from Loadrunner, and what are the settings to be changed in LR
    2.When QTP script is called into Loadrunner, how to Correlate it…?

  20. Dmitry Motevich Says:

    2 satish:
    You can read the following article to find out how to run QTP scripts from LoadRunner:
    http://motevich.blogspot.com/2007/11/execute-qtp-script-from-loadrunner.html

  21. cherry Says:

    Hi,good post!
    May I ask a question?
    I want to know how loadrunner calculate the data to generate the graphs.
    Thanks!

  22. Aju Sreekumar Says:

    When are you going to fill in all the TODOs :) I am missing some intriguing information in the RTS>>Browser Emulation>>Simulate Browser Cache>>Advanced.

  23. Sanjeevee Paniken Says:

    Hi, you all here seems to be very good in Load Runner. I am new to this subject and also new to QA… I am now learning Mercury Load Runner 8.1
    I have started the tutorial that comes with the application using MercuryWebTours web site. One thing is not working may be you can help me… i tried to use parameterization so as when my test run it will pick the values in the data grid which contains three values (e.g. Aisle, Window and None) However in my log i cant even see the word Parameter to check whether it is working or not.
    I am getting the warning.

    Action.c(120): Warning -26548: HTML parsing not performed for Content-Type “*/*” (”ParseHtmlContentType” Run-Time Setting is “TEXT”). URL=”http://127.0.0.1:1080/mercuryWebTours/FormDateUpdate.class” [MsgId: MWAR-26548]
    Action.c(120): web_url(”FormDateUpdate.class”) highest severity level was “warning”, 3058 body bytes, 159 header bytes [MsgId: MMSG-26388]
    Action.c(128): Warning -26548: HTML parsing not performed for Content-Type “*/*” (”ParseHtmlContentType” Run-Time Setting is “TEXT”). URL=”http://127.0.0.1:1080/mercuryWebTours/CalSelect.class” [MsgId: MWAR-26548]
    Action.c(128): web_url(”CalSelect.class”) highest severity level was “warning”, 227 body bytes, 158 header bytes [MsgId: MMSG-26388]
    Action.c(137): Warning -26548: HTML parsing not performed for Content-Type “*/*” (”ParseHtmlContentType” Run-Time Setting is “TEXT”). URL=”http://127.0.0.1:1080/mercuryWebTours/Calendar.class” [MsgId: MWAR-26548]
    Action.c(137): web_url(”Calendar.class”) highest severity level was “warning”, 3018 body bytes, 159 header bytes [MsgId: MMSG-26388]

    If anyone can help me please.
    Thanks for your response.
    Mr. Sanjeevee Paniken

  24. Chandan Says:

    Hi.. could any one of u please provide for the follwing error:

    Starting iteration 1.
    Starting action Action.
    Action.c(4): web_add_cookie was successful [MsgId: MMSG-26392]
    Action.c(5): Error -26624: HTTP Status-Code=407 (Proxy Authentication Required) for “http://www.google.com/” [MsgId: MERR-26624]
    Action.c(5): Warning -26200: At least one of the resources specified by EXTRARES has not been downloaded due to the above error(s) [MsgId: MWAR-26200]
    Action.c(5): web_url(”www.google.com”) highest severity level was “ERROR”, 2662 body bytes, 778 header bytes [MsgId: MMSG-26388]
    Ending action Action.
    Ending iteration 1.

  25. Kala Says:

    Hi,
    I am using LR 9.0 first time and I have few doubts.
    Can anyonep lease clarify my doubts.
    1. I need to browse some static content and then select some dynamic item from web page and from there i need to download pdf. I have to calucate time to perform this action.
    I have recorder and its giving problem at the time of replay.
    saying that
    “Microsoft Visual C++ Debug Library
    Debug Error
    Program path:
    Abnormal program termination
    Press retry to debug the application”
    When i click on retry the test windom automatically closing.

  26. Ananya Says:

    Hi,
    I am new to loadrunner. But I am facing a wierd problem while recording. So I would appreciate any help regarding this.
    I have downloaded the LoadRunner 9.1 Evaluation version from the HP site. I am trying to record opening a report (in a new window) in a Reporting platform. But looks like only the frame of the report is getting recorded but not the tabular content in the report.

    These are the step I followed:
    1. In VUGen, I openned a new script and chose Web(HTTP/HTML)
    2. Then just started to recording as an ‘Action’
    3. I stopped recording when the report came up with all the data, in the new window
    4. When I replay it on the report frame come up but not the data.

    Is there any initialization or any extra setup I can do to solve this.
    Appreciate your help.

    Thanks,
    Ananya

Leave a Reply