Thursday, 29 May 2014

Dynamic transaction names in Vugen scripting using load runner

       Most of the  times, we would like to see the performance a table fetch. Most of the times, when we work on applications that uses various filter conditions, we cannot incorporate all the filter conditions in a single script and infact, that is far from business need too. What we do in these conditions is, parameterize the search criteria and run the scenario. It would be very helpful if we can name this particular transaction with the filter condition that was applied for a particular iteration.


Solution:
Here we need to have a prefix transaction name first. For example, if I am searching for a document
with a different set of properties every time, like – approved, withdrawn, submitted etc., its better I
have a prefix transaction name like “T01_SearchDocWithStatus_” and then append to it the
parameterized value chosen.


char transactionName[100];

char* temp[50];

strcpy(temp,” T01_SearchDocWithStatus_”);

strcat(temp,lr_eval_string(“{DocStatus}”));

strcpy(transactionName,temp);

lr_start_transaction(transactionName);

web_url{


This way, when you run the scenario, you can look at the response times of individual status fetches

Note: That you cannot declare the transactionName as a pointer variable.

No comments:

Post a Comment