How to enhance Vuser Scripts of LoadRunner

Once the recording of Vuser is done, then, next step is to enhance the capabilities of the script by adding some functions. Here, in this post, I’m going to describe some basic and most commonly used function categories in brief:

  • General Vuser Functions: The Vuser functions which have LR as prefix are general functions. These functions enhance the functionality of any Vuser Script to a great extent.
Rest of the article will continue after below advertisement:

Sponsored Links:

  • Protocol specific Vuser Functions: These are the library functions used to enhance the script.
  • Standard ANSI C functions: This is enhancing the Vuser script by adding general C functions like Adding Control statements, loops etc.
  • Inserting Transactions into Vuser Script: Inserting Rendezvous point and Inserting Comments etc.
  • Sending Messages to output:
    • For Log Messages – Lr_log_message
    • For Debug Messages – Lr_set_debug_message and Lr_debug_message
    • For Error and Output Messages – Lr_error_message and Lr_output_message
  • Handling errors on Vuser Script during execution: When an error is encountered by Vusers, the Vuser stops the execution of the script. The function lr_continue_on_error can be used to override the continue on error runtime setting. The statements lr_continue_on_error(1); and lr_continue_on_error(0) can be used to mark the segment.
  • Synchronizing Vuser Script: Synchronize applies only to RTE Vuser Scripts. The output from the application needs to be synchronized the execution of Vuser scripts.
  • Emulate Vuser Think Time: The function lr_think_time is used to emulate user think time. (The time that a Vuser waits between performing successive actions is known as the Think Time). Think time can also be set at run time settings.

Apart from the above mentioned functions / methods, there are two other importants methods / concepts: Parameterization and Correlation. I’ll explain these soon in my next posts.

Search more stuff on LoadRunner, Performance Testing and Software Testing:


Categories: Basics Tags:
  1. No comments yet.
  1. No trackbacks yet.

Subscribe & Get FREE LoadRunner & Software Testing Stuff