VuGen: Dynamic Transactions Created From A Parameter File

From Michael Hendershot

Based on the search item I choose, I want a different transaction. This pulls the transaction name from parameter file and generates the transaction name off the “SearchFieldTransaction” column in my parameter file. Be careful. Tree view will take the “tmptransactionname” out of the lr_start and lr_end transaction.

Code:

Action()
{
    char tmptransactionname[25];
 
    sprintf(tmptransactionname,"%s",lr_eval_string("{SearchFieldTransaction}"));
 
    lr_start_transaction(tmptransactionname);
 
    lr_end_transaction(tmptransactionname, LR_AUTO);
 
    return 0;
}

Paramater File:

SearchFieldValue,SearchFieldType,TransactionName
All,All,S01_T01_Search_By_ALL
R000,Open,S01_T01_Search_By_OPEN
R001,In Progress,S01_T01_Search_By_INPROGRESS
R002,Complete,S01_T01_Search_By_COMPLETE
R003,Approved,S01_T01_Search_By_APPROVED
M999,Manual,S01_T01_Search_By_MANUAL

What's Next?

Did you enjoy this article? Help spread the word by sharing:

Join the Northway Navigator Club today and get access to restricted content including our best tips and tricks. Membership is free! You will also receive free email updates by registering.

Engage in the conversation and leave a comment:

Scott Moore

About Scott Moore (153 articles)

With over 20 years of IT experience with various platforms and technologies, Scott has tested some of the largest applications and infrastructures in the world. He is a Certified Instructor and Certified Product Consultant in HP’s LoadRunner and Performance Center products. He currently holds HP certifications for ASE, ASC, and CI. A thought leader in the APM space, he speaks regularly at IT conferences and events