Top 10 Loadrunner Functions

Top 10 LoadRunner Functions :

Below are the most 10 important loadrunner functions present in loadrunner.

lr_end_sub_transaction :

  • lr_end_sub_transaction function marks the end of a sub-transaction.
  • So insert these functions immediately before and after the sub-transaction steps.

lr_end_transaction :

  • lr_end_transaction function marks the end of a transaction and records the amount of time it took to perform the transaction.
  • It has LR_Fail, LR_Pass, LR_stop and LR_Auto Status.
  • So you can manually set the status of the transaction according to your need.

lr_start_transaction :

  • lr_start_transaction function marks the beginning of a transaction.
  • So the transactions can be nested, but each lr_start_transaction statement must be associated with an lr_end_transaction statement or it will be interpreted as an illegal command.

lr_start_sub_transaction :

  • lr_start_sub_transaction function marks the beginning of a sub-transaction.
  • Sub-transactions are used for isolating parts of a business process.
  • Multiple sub-transactions can be nested within a parent transaction.
  • But a sub-transaction may also be a parent to a smaller sub–transaction.

Click Here to see all the transaction function present in loadrunner.

lr_eval_string :

  • lr_eval_string function returns the input string after evaluating any embedded parameters.
  • So if the string argument contains only a parameter, the function returns the current value of the parameter.
  • Example : lr_save_int(47, "searchCount");

lr_save_string :

  • lr_save_string function assigns the specified null-terminated string to a parameter.
  • But the functions is useful in correlating queries.
  • Example : lr.save_string("John Doe" , "Student" );
Click Here to see all the string function present in loadrunner.

lr_error_message :

  • lr_error_message function sends an error message to product output windows log files, and other test report summaries.
  • Example : lr_error_message("Error: %s", "Unable to login to secure computing");

lr_log_message :

  • lr_log_message function sends a message to the Vuser or agent log file (depending on the application), and not to the output window.
  • So you can use this function for debugging by sending error or other informational messages to the log file.
  • But in a standalone program such as VuGen, lr_log_message sends the message to the viewer and output.txt.
  • Example : lr_log_message ("login failed: %s", abort);}

lr_output_message :

  • lr_output_message function sends a message with the script section and line number to output windows, log files, and other test report summaries.
  • Example : lr_output_message( "We are on iteration #%s", lr_eval_string( "{iteration}" ) );

Click Here to see all the message function present in loadrunner.

lr_think_time :

  • lr_think_time allows you to pause test execution during a run.
  • But this is especially useful in simulating think time, the time a real user pauses to think between actions.
  • Example : lr.think_time(1);

Click Here to see all the run time function present in loadrunner.

One thought on “Top 10 Loadrunner Functions

Leave a Reply

Your email address will not be published. Required fields are marked *