Posts Tagged ‘VUGen’

Quick Tip – Validating Authentication Test Data in LoadRunner

Posted on October 31st 2010 by Joel Deutscher

LoginHere is a familiar situation. Thousands of potential accounts for use in performance testing, some of which work, some don’t. In this example, it’s the login credentials. This usually requires you to run through your test data one by one to see which accounts work, and which don’t, removing the accounts that error. By turning off HTTP redirects, you can speed up this process significantly.

This example script is a minimalist way of checking the data in a fairly quick way, without the burden of actually loading the pages. All you need to know is the URL that you are redirected to on successful login (or failure). In this example, the user is redirected to /dashboard.php on successful login.

// Disable HTTP Redirects to time Authentication
web_set_option("MaxRedirectionDepth", "0", LAST);

// Find Authenticated URL
web_reg_save_param("redirect_url", "LB=Location: ", "RB=\r\n", "Search=Headers", LAST);

web_submit_data("web_submit_data",
	"Action=http://www.headwired.com/login.php",
	"Method=POST",
	"TargetFrame=",
	"Referer=https://www.headwired.com/login.php",
	"Snapshot=t3.inf",
	ITEMDATA,
	"Name=username", "Value={INPUT_USERNAME}", ENDITEM,
	"Name=password", "Value={INPUT_PASSWORD}", ENDITEM,
	LAST);

if(!strcmp(lr_eval_string("{redirect_url}"),"https://www.headwired.com/dashboard.php")) {
	// Login Successful
	lr_output_message(lr_eval_string("Login Successful - {INPUT_USERNAME},{INPUT_PASSWORD}"));
}

Some of you may want to write the valid and invalid accounts to a file, yet for a once off execution, this method suits me just fine.

Fix Slow VuGen Replay?

Posted on October 8th 2010 by Joel Deutscher

StopwatchQuick tip: If you find VuGen is running slowly, it’s probably because you have the parameters data file open.

How much slower you ask? On a longer script I saw run-time drop from 415.8620 seconds to 50.2816 seconds

The good news is, closing the parameters file provides an instant boost of speed.