Posts Tagged ‘Code’

Using mldap_modify & mldap_delete functions in LoadRunner

Posted on September 20th 2011 by Joel Deutscher

Deleted
I have written before about using the LDAP protocol using LoadRunner. This time, I had a requirement to reset the passwords for all my test users before an execution. Luckily for me, there was already some shell scripts setup that utilised ldapmodify, so it was just a matter of converting them over to LoadRunner scripts.
Continue Reading…

Performance Testing SOAP with LoadRunner – Basics

Posted on August 10th 2011 by Joel Deutscher

Simple Object Access Protocol (SOAP)Web services are more commonly becoming the targets of Performance tests. This post aims to provide an introduction to testing SOAP with LoadRunner without using the Web Services VUser type. Why not use the Web Services Vuser? Errors like this

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Xml.XmlException: 'xsi' is an undeclared namespace.

Using the custom web request (as suggested by Wilson Mar, Stuart Moncrieff and many others) bypasses the XML validation steps of LoadRunner, which is a good thing. This is possible because SOAP is just XML over HTTP, so lets take a look.
Continue Reading…

Dynamic Parameter Names in LoadRunner

Posted on January 4th 2011 by Joel Deutscher

Occasionally, you might want to perform the same action multiple times with different parameters. While you should be very carefull with this type of scripting, the following is a basic example of how to do this in LoadRunner.

The following script will perform three searches on google.com.au using three different parameters.

Action()
{
	int i;
	char temp[10];

	// Progress Through 3 Client IDs stored in {Param_1}, {Param_2} and {Param_3}
	for(i=1;i<4;i++) {
		sprintf(temp,"{Param_%d}",i );
		lr_save_string(lr_eval_string(temp), "Param_Value");
		lr_start_transaction("Search");

		// Extract Variables
		web_reg_save_param("Number_of_Results", "LB=About ", "RB= results", LAST);

		// Validate Content
		web_reg_find("Text={Param_Value} - Google Search", LAST);

		web_url("search", 
			"URL=http://www.google.com.au/#hl=en&q={Param_Value}", 
			"Resource=0", 
			"RecContentType=text/html", 
			"Referer=", 
			"Snapshot=t1.inf", 
			"Mode=HTML", 
			LAST);
 
		lr_end_transaction("Search", LR_AUTO);
	}
	return 0;
}