Creating LoadRunner Dynamic Transaction Names

Today I wanted to use parameterized transaction names within a LoadRunner script. As I thought that a particular transaction was failing after a particular number of iterations. Luckily this was pretty simple in LoadRunner. It was just a case of using lr_eval_string in the call to the transaction wrapper.

lr_start_transaction(lr_eval_string("Do Something {pIteration}"));

lr_end_transaction(lr_eval_string("Do Something {pIteration}"), LR_AUTO);

You have to be careful above to make sure that start and end transaction names are the same. To overcome that problem I created a string variable to hold the LoadRunner transaction name.

char sTranName[20];

sprintf(sTranName,lr_eval_string("TransactionA_{pIteration}"));
lr_start_transaction(sTranName);

lr_end_transaction(sTranName,LR_AUTO);

Advertisements

One thought on “Creating LoadRunner Dynamic Transaction Names

  1. http://loadrunnertips.com/LoadRunner_transaction_naming_tool.aspx

    Transaction naming in VuGen is very easy if there are 4 or 5 transaction in your script, but that is not the case because I come across with application which have more the 100+ transaction. What to do? sit all the day and name all 100+ transactions naming…. No here the tool for you which will generate the transaction name for you and update it in your script and save your lots of time do share with your friends if you like this tool or you have any suggestion for us.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s