Wednesday, December 11, 2013

Dynamic transaction names in Load runner | Dynamic Transaction names in Vugen | Dynamic transaction names with Iteration number in LR

Sometimes you may want to create transaction names on your own. These may be with iteration numbers or with parameter values which are present in the parameter file. I will show you an easy way to do this. follow here.

The transaction names should be used with lr_eval_String as below

lr_start_transaction(lr_eval_string("The script is now at the iteration number# {IterationNumber}"));

lr_end_transaction(lr_eval_string("
The script is now at the iteration number# {IterationNumber}"), LR_AUTO);

Please make sure the Tx names of Start and End should be same, You need to pass the same value in Start and End Transactions so try to use the below code. Here the sTransName is a variable which holds the value of transaction name

Action()
char sTransName[50];

sprintf(
sTransName,lr_eval_string("TransactionA_{IterationNumber}"));

lr_start_transaction(
sTransName);

lr_end_transaction(
sTransName,LR_AUTO);

 return 0; 
}