Friday, December 30, 2011

Loadrunner SOAP over JMS script for Websphere MQ

How to submit a SOAP over JMS request to Websphere MQ using LoadRunner SOA protocol?

  1. JMS Queue details
  2. Websphere MQ Client installed (if not installed, instructions are below)
  3. Websphere MQ jar files installed (if not installed, instructions are below)
  4. JDK installed (if not installed, instructions are below)

JMS Queue Details
Depending on which queue(s) you want to send and receive a message from as well as the MQ architecture design, you will require following MQ information from your Websphere MQ Admin.
  • HostName
  • Channel
  • Port
  • Queue Manager
  • Input Queue
  • Output Queue
  • Queue Connection Factory
  • Username and password

For example, in my case, to send a message to an Input Queue, following information was required:
  • HostName –
  • Channel - ICF.DEF.SVRCONN
  • Port - 1414(might be different)
  • Queue Manager - Not Required
  • Input Queue - Input_queue_name
  • Output Queue - Not Required
  • Queue Connection Factory - qcf
  • Username and password - Not required
Webshere MQ Jar files
  1. Install JAVA JDK on your local machine
  2. Copy MQ jar files into the JDK...->Java ->jre-> ext folder. You will need to get these jar files from your Webpshere MQ admin
  3. Also, since we are using fscontext as initial context factory, you will need to download and save fscontext and providerutil.jar files in the above mentioned folder
How to create JNDI binding
  1. Install Websphere MQ Client application on your local machine.
  2. Navigate to the location where JMSAdmin.config file is located and open it. We are going to select a context factory to use and path where to create the binding file. In my case this file is located at C:\Program Files (x86)\IBM\WebSphere MQ\Java\bin Update and save the file with following details:
  3. INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory PROVIDER_URL=file:/C:/JNDI
  4. Create a new qm.scp file (make sure this file is in the same folder as JMSAdmin.bat file) and put there the MQ details. The .scp file will look like this:
  5. DEFINE QCF(qcf) tran(client) chan(ICF.DEF.SVRCONN) host( port(1414) DISPLAY QCF(qcf) DEFINE Q(Input_queue) QUEUE(Input_queue) DISPLAY Q(Input_queue) end
  6. Create the JNDI folder on your C drive. This is where your binding file will automatically be saved.
  7. Navigate to “...\WebSphere MQ\Java\bin” and edit JMSAdmin.bat by replacing “java” text with the full java path incase it is not already defined in your System environment settings.
  8. Navigate to Websphere MQ Java bin folder via the command prompt and execute the JMSAdmin Tool (JMSAdmin. Bat file) with qm.scp as the parameter. This will generate a .bindings file in the JNDI folder automatically.

  9. You will see something like this when JMSAdmin bat application is executed.
    Cool, JNDI binding is done.
Creating a Webservices Loadrunner Script
  1. Open up a new web services script.
  2. Press F4 to Navigate to Run-time setting and update the following fields in JMS->Advanced option:
  3. -JVM Home: JAVA path
    -JNDI initial context factory: com.sun.jndi.fscontext.RefFSContextFactory
    -JNDI provider URL: file:/C:/JNDI/
    -JMS connection factory: QCF name
  4. Now you are ready to create your MQ script.
  5. You can then use Web Services jms_set_general_property, jms_send_message_queue, jms_set_message_property and jms_receive_message_property functions.
NOTE: JMS Bindings Extensions are not supported in Loadrunner 11.

Thursday, December 22, 2011

How to monitor JVM running in Loadrunner mmdrv process

If you are testing SOAP over JMS using Web Services protocol in Loadrunner, you can monitor JVM(in process) which is invoked by mmdrv.exe, either using JConsole or JVisualVM or any other tool that allows you to monitor JVM.

Before you use JConsole or JVisualVM, you will need to set jmxremote parameter in Loadrunner. To do so, add “” as a Value in the “Additional VM Parameters” textbox. See the figure below.

Now, run your script and open up JVisualVM to monitor the JVM running within the mmdrv process.

NOTE: If you are using JVisualVM tool for monitoring then you do not need to set remote jmx parameter. It is only required for Jconsole.

Wednesday, November 9, 2011

WebSphere MQ - 'java' is not recognized as an internal... error message

You might get the 'java' is not recognized error message when generating a binding for WebSphere MQ using JMSAdmin tool.

C:\...\WebSphere MQ\Java\bin>JMSAdmin < qm.scp

Running the batch file might give you the following error message:
'java' is not recognized as an internal or external command, operable program or batch file.

Step 1: Open up your JMSAdmin batch file using notepad. It will look something like this.

Step 2: Find out the full Java path on your local machine. In my case the Java file is located in the following folder:
C:\Program Files (x86)\Java\jdk1.7.0_01\bin\Java

Step 3: Replace “Java” with your Java path from Step 2. Save the file.

Step 4: Run the JMSAdmin again. This time your binding is created.

Sunday, November 6, 2011

Connecting to Opensolaris from Mac using SSH

Following is a command on how to access an Opensolaris system (VM) running on a local machine. In this case it is my Mac.

NOTE: Make sure you have a username & password setup on Opensolaris to access it via SSH. More information on SSH can be found here.

$ ssh -x username@hostaddress

$ssh -x hpseera@

Tuesday, October 11, 2011

Using LoadRunner to capture SOAP requests generated using soapUI application

How to capture soapUI request(s) in LoadRunner.

1: A SOAP request has already been created in soapUI. I am using Metric Weight Unit Convertor WSDL from webserviceX for this problem.

1: Select an Web HTTP/HTML protocol in LoadRunner.

2: In Start Recording window, input the following options:
Application type: Win32 Applications
Program to record: "...\HP\LoadRunner\bin\micexec.exe" -->micexec.exe path
Program arguments: "...\soapUI-4.0.0.exe" -->soapUI path

3: Click OK button. This launches the soapUI application.

4: Run the SOAP request in soapUI. You will notice that LoadRunner is now capturing the soapUI traffic.

5: Stop the LoadRunner recording, once soapUI has finished submitting the request. You will notice that the same request created in soapUI has been captured in LoadRunner.

6: Replay the script in the LoadRunner and you will notice that the correct response is returned.

You might get "The JVM could not be started. The maximum heap size (-Xmx) might be too large or an antivirus or firewall tool could block the execution" error message.

You can fix this issue by updating the -Xmx value in the soapUI-4.0.0.vmoptions file. Reduce the size JVM Xmx value. In my case, I reduced it from 1200 to 512. This fixed the issue and I was able to record the script. You might also get OutOfMemory issue when launching soapUI using LoadRunner. This is because the maximum heap size set in soapUI is less than the memory required by soapUI to successfully launch. Increase the heap size to what the soapUI application requires or remove the unnecessary projects.

Saturday, October 1, 2011

Using Regular expression and SaveLen attribute in LoadRunner

How do you capture a variable in LR that has a dynamic right boundary?

Depending on the data I used in a project (Siebel Project), the right boundary of a row ID that I wanted to capture from a response would change. For example,
1: Data set 1 would return following response - ...*Y1*Y10*1-1YK-49251*11*11*N1*...
2: Data set 2 would return following response - ...*Y1*Y10*1-2XY-45233*11*11*N1*...
3: Data set 3 would return following response - ...*Y1*Y10*1-1KM-72142*11*11*N1*...

In the above response, I needed to capture the row ID "1-1YK-4925","1-2XY-4523" & "1-1KM-7214" respectively. As you can see, the right boundary is different for different data set and therefore just passing left and right boundary values in web_reg_save_param, would fail or/and capture wrong row ID value.

web_reg_save_param("rowID","LB=*Y1*Y10*","RB=1*11*11*N1*",LAST); --Will fail for data set 2 & 3. Same thing will happen if you are using RB from data set 2 and 3.
web_reg_save_param("rowID","LB=*Y1*Y10*","RB=*11*11*N1*",LAST); --will fail for all data sets because an extra character is saved in Temp parameter.

Possible solution:
As you might have noticed, the row ID that we want to capture consists of 10 characters and therefore we could use one of the following approaches to solve this problem:

1: SaveLen attribute- since we know that the number of characters for row ID, we can use SaveLen Attribute in web_reg_save_param function to capture the correct value.

2: Regular expression- Second approach is to use regular expression to capture the row ID. Their is a really good blog written by Dmitry Motevich on how to use regular expression in LoadRunner.

To demonstate the above two approaches in Siebel, I have used three parameters to save the row ID value from the server response (see the image below):

1: SubActivityIDWithoutRegAndNoSaveLen - this parameter is captured using web_reg_save_param without SaveLen attribute. In this case a wrong value is captured.

2: SubActivityIDWithoutRegAndSaveLen - this parameter is captured by passing SaveLen value in web_reg_save_param function. In this case a right value is captured.

3: SubActivityIDWithReg - this parameter is captured using web_reg_save_param and then passed into the regular expression function to get correct rowID. In this case the pattern that matches the above value is "\\d-[0-9A-Z]{3}-[0-9A-Z]{4}" and right value is returned.

From the RunTime Data window you can see that the final value of the parameter captured using the regular expression and SaveLen attribute are the same.

Therefore, depending on your situation, you might be able to use any one of these approaches to capture a value that has dynamic boundaries.

ALM - CLoader error

CLoader error is encountered when accessing the HP ALM application via IE8 on Windows 7 for the first time, even if you are an administrator.

Open IE8 using "Run as administrator" option.

Saturday, September 10, 2011

Using MySQL database for LoadRunner parameter

Recently, a friend wrote a blog where he solved a tricky situation by using parameter file rather than using database for parameter. The scenario was as follows:

"This particular scenario required that a user logged on to the Application can only perform particular searches based on criteria defined and assigned to that particular user. That is,VUSER1 can only search on terms1, terms2 and terms3 whilst VUSER2 can only search on terms4, terms5 and so on."

I have not come across a situation where I had to use database for LR parameter. Therefore, as a challenge(as well as to learn something new) I wrote a simple LR script to solve this problem using database.

1: You will need to add error handling code to the script.
2: Haven't had a chance to check out how much memory this code consumes since I am using mysql_store_result function to store the result into memory.
3: All the applications were running on localhost. You will need to change the database connection details, if you need to connect to remote MySQL server.
4: Also you will need to add all the library files and DLL(see below) on a system that will be executing this script. That is either the vugen or LR agent machines.


1: You will first need to download and install MySQL database.
2: Download C driver for MySQL (Connector/C)
3: Create a database, table and add records into the table as shown below in screenshot.

4: In LoadRunner you will need to include mysql.h header file which comes with C driver. You might also need to update path of the following header files in mysql.h.

5: You will also need to add a function to load the DLL(libmysql.dll) which allows LR to connect to the MySQL database. Add this file in the vuser_init function.

6: You will need to add all the database connection details. You will need to replace the below values with your database details.
char *MySQLserver = "localhost";
char *MySQLuser = "root";
char *MySQLpassword = "";
char *MySQLdatabase = "loadrunner";
int MySQLport = 3306;

7: Your global.h and vuser_init will look something like this.
 //libmysql.dll file loaded using lr_load_dll function
 MyRC= lr_load_dll("C:\\Program Files\\MySQL\\MySQL Connector C 6.0.2\\lib\\opt\\libmysql.dll"); 

 //initialise mySQL connection handler
 mySQL= mysql_init(NULL);
 // Connect to the database
 mysql_real_connect(mySQL,MySQLserver, MySQLuser, MySQLpassword, MySQLdatabase, MySQLport,NULL,0);

 //save SQL statement into variable into sqlQuery
 //This stamentement returns result that matches UserName = {Vuser} parameter
 lr_param_sprintf("sqlQuery","SELECT SearchTerm FROM lrdata WHERE UserName='%s'",lr_eval_string("{Vuser}"));

 //Execute SQL statement
    mysql_query(mySQL, lr_eval_string ("{sqlQuery}"));

 //result of the sql statement is placed into MYSQL_RES result structure
 result = mysql_store_result(mySQL);

 //num_fields = mysql_field_count(mySQL);

 return 0;

8: In Action function, add following code.
NOTE: Make sure you have created an LR parameter called "Vuser" that has a text format "Vuser%s" so that a correct vuser name is passed into the sql statement.

//1: initialize connection handler
//2: connect to the database server
//3: Execute SQL statement
//4: Close the connection to the database server 

 row=mysql_fetch_row(result);   //retrive next row of the fetched result

 //Incase # of transactions to be executed is more than returned sql result
 //move the result pointer to first row
 // This is similar to "Continue in cyclic manner" for When out of values option in LR    
       lr_output_message("The searched term for [%s] is: [%s]",lr_eval_string ("{Vuser}"), row[0]);
 else  // print the fetched row 
  lr_output_message("The searched term for [%s] is: [%s]", lr_eval_string ("{Vuser}"),row[0]);

 return 0;

9: In your vuser_end function add following code.
    //free the memory allocated to result structure and close the database connection

 return 0;

10: Running this code for five iterations, we get following result.

If you find any bugs in the code or you have an updated(/improved) version of this code, please leave a comment.

Saturday, September 3, 2011

Property Transfer in soapUI

Property transfer function (/TestStep) provides an option to transfer properties between TestSteps and their TestCase, TestsSuite and Project. For example, Property transfer TestStep could be used to pass sessonID value extracted from a response of one request into subsequent request.

Alright let’s get started on how to transfer a property.

Assumption: soapUI application is installed on your machine.
For blogging purpose, I am using free soapUI 4.0 incase you do not have Pro soapUI.

Step 1:
First we will need a wsdl. For demonstration purpose, I am using Metric Weight Unit Convertor.

Step 2: Start the application and then navigate(File ->New soapUI project) to New soapUI project window.

Step 3: Enter a project name in Project Name text box. Lets call it "WeightConvertor". Also enter the wsdl URL from step 1 into Initial WSDL/WADL textbox. See the screenshot below:

Step 4: click OK button. If the application is able to successfully access the WSDL then a new project called "WeightConverter" is added under "Projects" list. You will also see the Bindings. If you expand those bindings, you will see Operations and SOAP requests.

Step 5: Right click "WeightConverter" project and Click "New TestSuite" option. Enter a TestSuite name (i.e. Metric TestSuite) in the textbox and click OK button. A TestSuite is created under the WeightConverter project.

Step 6: Right click the TestSuite and select "New TestCase" option. Enter a TestCase name(i.e. WeightTestCase) in the textbox and click OK button. A TestCase is created under the TestSuite. A TestCase window is displayed.

Step 7: Add two steps to this TestCase. One step called as "GramToKilogramStep" and other one called "KilogramToGramStep". Make sure you follow all the steps required to create these steps. Finally you will have something like this as shown in the screenshot

Step 8: Double click "GramToKilogramStep" and enter following values in place of question mark.
MetricWeightValue = 3000
fromMetricWeightUnit = gram
toMetricWieghtUnit= kilogram
Once done click on the Green Run button. If successful, you should see "3" in the response. See the screenshot below.

Step 9: Double click "KilogramToGramStep" and enter following values in place of question mark.
fromMetricWeightUnit = kilogram
toMetricWieghtUnit= gram
NOTE: Leave MetricWeightValue as it is. We want to pass the value received in step 8 above using Transfer Property TestStep into this variable. If you try to run this step, you will get"Server was unable to read request" error response.

Step 10: Right click "Test Steps" and add a "Property Transfer" step. The step will be added at the bottom of the test step list. A Property Transfer window is displayed.

Note: You want this step to be between the two steps so that the value captured in GramToKilogramStep is passed to KilogramToGramStep. Therefore, hightlight the step and move it between the two steps.

Step 11: Enter a name for Transfer by clicking the "Plus" sign in the Property Transfer window.

Step 12:
In Source dropdown, select "GramToKilogramStep" and Property as "Response"
and in Target dropdown, select "KilogramToGramStep" and Property as "Request". In the source text box, we will need to declare a namespace and enter the XPath of the property that we want to transfer. See the screenshot under step 13.

Step 13: Once done, run the test step and in transfer log you will notice that pResponse has a value 3 now. See the screenshot below.

Step 14: Open up the "KilogramToGramStep" test step. You will now notice that "MetricWieghtValue" has automatically been assigned value 3. Run the step and you will see the correct response from the server with Result as 3000.

Well this sum up how to use Property Transfer TestStep to transfer a value from a response to a request.

Wednesday, August 17, 2011

LoadRunner 11 - Adding a Plugin to TrueClient Firefox browser

LoadRunner 11 comes with a new protocol called TruClient. It records a business process using the Firefox browser. By default, the browser does not come with plugins such as Firebug. However, you can still add a Firefox plugin and use it while using TruClient during scripting process. For demonstration purpose, I will show you how to add "Firebug" plugin to the TruClient browser and the steps are as follows:

1: Select the TruClient protocol and then click Tools -> Ajax TruClient Browser Configuration option. An "Ajax TruClient Browser Configuration" popup window is displayed.

2: Click on "Extensions" tab. All existing plugin list will be displayed. See the screenshot below.

3: Click on "Get Add-Ons" button. All the recommended plugin list is displayed.

4: Type in "Firebug" in the search textbox and click "Search" icon. A result list is displayed. Incase you do not see the "Firebug" plugin, click on "See all results..." link. This will bring up the list of all the plugins in a browser.

5: Click on "Add to Firefox" button next to the Firebug plugin and follow all the necessary steps. Once the Firebug is installed. Restart the Firefox browser.

6: If the browser is open, close the browser and click "Develop Script" button in VUGen. This will open up a Firefox browser. At the bottom right corner of the browser, you will now see a firebug icon. Firebug plugin is now ready to be used while you are recording a script using TruClient protocol.

Tuesday, August 16, 2011

LoadRunner - Converting Number Into Currency(/Dollar)

Couple of times when scripting a business process, I have come across situations where I needed to submit a dollar amount. For example, I would type in a number 12345 in a textbox and the application would convert it into $12,345 before submitting the request. There are three ways to solve this problem and they are:

1: Hard code the dollar value in the request. I wouldn't suggest doing it this way. However, there might be situations where it might be OK to hard code the value.

2: Save dollar values in a text file and then use a LR parameter for your requests.

3: Another way is to write a C function which converts a number into a dollar(/currency) value, which you can later assign to an LR parameter. The code is as below:

char *ConvertStringToCurrency(char string[20])
char *tempResult; //temporary result variable
int counter;
int i=0;
tempResult= (char *)malloc(sizeof(string)+10); //dynamically allocate memory for variable tempResultmake sure there is enough space for extra characters that will be added.


if((strlen(string)-counter)%3==0 && counter!=0) //insert a comma every third character  and not at the start.

return tempResult;   //return final currency

    char *tempCurrency;

 tempCurrency = (char *)malloc(sizeof(lr_eval_string ("{NonCurString}"))); //dynamically create the size of tempCurrency var based on size of NonCurString parameter

 sprintf(tempCurrency,"%s",lr_eval_string ("{NonCurString}")); //save NonCurString paramater value in to tempCurrency var

 lr_output_message ("Before Conversion %s",tempCurrency); //output the currency value before conversion

 sprintf(tempCurrency,"%s",ConvertStringToCurrency(tempCurrency));  //save the new value into tempCurrency 

 lr_save_string (tempCurrency,"Currency"); //save the tempCurrency value into parameter called Currency

 lr_output_message ("After Conversion %s",lr_eval_string ("{Currency}")); // output the Currency value

 return 0;

You will require to update the above code incase the final value is bigger than 20 characters. My code assumes the inital number is not bigger than 10 characters. This allows me to assign the final value back to variable "tempCurrency".

NOTE: Make sure you are freeing the memory. This code does not free the memory as I have left it for you to add that code.

Following is a screenshot of the final result when the above code is executed in LoadRunner.

How To Access(& Monitoring) Apache Server Counters

The Apache server comes with different counters which allows you to monitor the health of the server. When extended status is enabled you can not only access default counters but also the following counters. They are:

Extended Status ON
*Total Accesses - Total access count since the server was started
*Total kBytes - Total volume delivered in bytes since the server was started
*Uptime - Time during which the server was running
*ReqPerSec - Average number of requests per second since the server was started
*BytesPerSec - Average number of bytes delivered per second
*BytesPerReq - Average number of bytes per request
*CPULoad - not available on most Win32 versions

Default Counters
*BusyWorkers - Number of worker processes actively processing requests
*IdleWorkers - Number of worker processes idle

How To Access The Apache Counters
The following steps are based on Apache 2.2 version (it was installed as part of XAMPP application). Also I am running the server on my local machine.

1: Open up the httpd.conf file. If installed via XAMPP, this file is found in the "conf" folder in the main "Apache" folder.
2: Search for "status_module" module and remove "#" tag infront of LoadModule text, incase it exists. Change "#LoadModule status_module modules/" to "LoadModule status_module modules/". See the screenshot below.
3: Restart the Apache Server for server to pick up the changes made to conf file.
4: Navigate to "http://localhost/server-status?auto" URL. Now you should be able to monitor the default counters(see the screenshot below). If the server is running on a remote machine then the URL will be "http://servername:port/server-status?auto".

To get further Apache counters, perform the following actions:
5: Add "ExtendedStatus On" text at the bottom of the httpd.conf file. See the screenshot below.
6: Restart the Apache Server for server to pick up the changes made to conf file.
7: Navigate to "http://localhost/server-status?auto" URL. Now you should be able to view the default counters as well as the extended counters(see the screenshot below).

If you want further information such as "PID", "DNS Lookup", "Waiting for Connection", "Reading Request", Server Version etc, then just navigate to the following URL ("http://localhost/server-status") on your localhost or "http://servername:port/server-status" for remote server. See the screenshot below.

NOTE: By default ExtendedStatus is not enabled. When enabled it will make multiple time calls and this can cause a performance hit.

NOTE:Once you have enabled the status, you can access these counters via the HP SiteScope application.

Wednesday, July 27, 2011

LoadRunner Siebel protocol - Failed to load the "LrwiSiebelCorrelationWrapper.dll"

When working with Siebel protocol in LoadRunner 11, you might get following error message 'Failed to load the "LrwiSiebelCorrelationWrapper.dll" auto-correlation callback library. The specified module could not be found.'

Make sure ssdtcorr.dll file exists in the LoadRunner bin folder.

Wednesday, July 13, 2011

LoadRunner 11 patches

Below is a list of all available LoadRunner 11 patches. You will be required to login to the website to download them. Also, if you don't have Contract identifier number(SAID) then you might not be able to download the patches.

From HP website
After a clean installation of LoadRunner 11 there are 3 important patches available so far. The patches are mandatory and should be installed by all LoadRunner customers. All patches are accumulative, that is, the newest one contains all of the previous ones. However due to issues with the uninstallation any of the first 2 (Critical or Patch 1) should be present before installing Patch 2.

1.LoadRunner Critical Patch - LR_03014: KM999242
2.LoadRunner Patch 1 - LR_03017: KM1035229
3.LoadRunner Patch 2 - LR_03044: KM1088984

Patches for Load Generator systems (Windows OS):
1.Load Generator Critical Patch - LRLG_00002: KM999240
2.Load Generator Patch 1 - LRLG_00003: KM1035228
3.Load Generator Patch 2 - LRLG_00005: KM1088990

Patches for Load Generator systems (Other OS)
***Linux (RedHat)
1.Load Generator Patch 1 Linux - LR_03036: KM1036177
2.Load Generator Patch 2 Linux - LR_03057: KM1088983
1.Load Generator Patch 1 HP-UX - LR_03037: KM1036186
2.Load Generator Patch 2 HP-UX - LR_03058: KM1088982
1.Load Generator Patch 1 Solaris - LR_03038: KM1036183
2.Load Generator Patch 2 Solaris - LR_03059: KM1088981

Patches for VuGen 11 StandAlone
1.VuGen SA Critical Patch - LRVUG_00002: KM999238
2.VuGen SA Patch 1 - LRVUG_00003: KM1035227
3.VuGen SA Patch 2 - LRVUG_00011: KM1088992

Patches for Analysis 11 StandAlone
1.Analysis 11 SA Patch 1 - LRANLSYS_00002: KM1035232
2.Analysis 11 SA Patch 2 - LRANLSYS_00006: KM1088991

Note: There is a new patch 3(KM1170997) available for LoadRunner 11. This new patch came out in June 2011

Sunday, June 12, 2011

IE8 quirk- CSS file requested twice when you use relative protocol path

In IE8, if you use a relative protocol path for CSS file, it is downloaded twice. In the screenshot below I have used an absolute path for master.css file and relative path for master1.css. As you can see, two requests are made for master1.css file and only one request for master.css. There is no such issue for javascript file. The jquery file uses relative path in this example and only one request is made.

Therefore, make sure you are using an absolute protocol path for CSS file and not relative protocol path.

Reference object in a local variable

Recently, I have been playing around with javascript and I have to say it is fun. I was trying to append an element to a document and to my surprise, if you do not reference an object in a local variable, it takes longer to append, the more elements you have.

Following is a code that I used for testing.

The result of this test is shown in the table below:

The more elements you append, the longer the execution time is when you do not use a local variable. In the table above, it took almost 4 seconds to append 100000 elements when no local variable was used and almost 3.2 seconds when a local variable was used. This is almost 800ms saving. For elements less than equal to 10, the execution time was similar or I did not see huge difference.

In my code I have a local variable(Wholebody) which is assigned a reference to document.body. Rather then using document.body, I am using Wholebody in the for loop.

Note: I tested this code against IE 8.0. The result might be different on different browsers.

Thursday, April 28, 2011

Threadsafe protocols in LoadRunner

How to findout which protocols are threadsafe in LoadRunner?

Except for Sybase-Ctlib, Sybase-Dblib, Informix, Tuxedo and Peoplesoft-Tuxedo protocols, all other protocols are threadsafe (see the screenshot below of LR9.5 Vugen User Guide).

Alternatively, you can check each protocol as follows to findout whether it is threadsafe or not.
1: Go to ...\LoadRunner\dat\protocols folder
2: Open up an appropriate .lrp file (i.e. QTWeb, Tuxedo)
3: Search for "EnableThreads". If this parameter value is set to 1 then it is threadsafe else it is not.
    For example: QTWeb has EnableThreads=1
                          Tuxedo has EnableThreads=0

Thursday, March 3, 2011

Gomez - Data summary information may be incorrect

If you have used Gomez tool for last mile performance testing, you may have noticed that metrics on Test Breakdown(Data Summary) page does not add up. In the image below you will notice that the time to first byte (1stByte column) is more than the total page response time(Response Time column).

The way Gomez is calculating these values is by adding up response time of same component in all the requests together. For example, In the above image, the DNS time is 0.144 but if you look at the waterfall chart below, you will notice this time is sum of DNS compoment response time of two requests.

You can also have time to first Byte or content download time to be more than the page resonse time. Therefore, I suggest a caution need to be taken when interpreting results from GOMEZ or even presenting them to someone else.

Gomez - Uploading transaction Script to Gomez portal

If you have recorded a business process using GOMEZ Recorder and you want to upload it to their server(so that you can run transaction last mile tests), this is how you have to do it.

1: Download GOMEZ Recorder from Gomez Portal.

2: Record the business process using GOMEZ Recorder. Make sure the script replays correctly and once done, click on File->Save (remote) button.

3: If you are uploading the script for first time, you will get a login popup window. Enter your Login details (UserName and Password) that you use to login to GOMEZ portal.

4:Once your credentials are verified, a "Save to Gomez Platform" popup will be displayed. Enter the script name and click Save button.

5: Login to the GOMEZ portal and navigate to "Add Last Mile Tests" page.

6: Click on Script dropdown button and there you go, You have your uploaded transaction script.