0% found this document useful (0 votes)
194 views7 pages

How To LR GWT

This document provides instructions for using Loadrunner to test the performance of applications built with Google Web Toolkit (GWT). It discusses setting up the environment to use the proper Java version, configuring recording options to parse GWT requests, creating a Data Format Extension (DFE) chain to decode requests, checking the script and requests, and handling parameterization, correlation and errors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
194 views7 pages

How To LR GWT

This document provides instructions for using Loadrunner to test the performance of applications built with Google Web Toolkit (GWT). It discusses setting up the environment to use the proper Java version, configuring recording options to parse GWT requests, creating a Data Format Extension (DFE) chain to decode requests, checking the script and requests, and handling parameterization, correlation and errors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

LOADRUNNER SCRIPTING FOR GWT APPLICATION

Ritwik Mukhopadhyay
Performance Test Engineer
Since last few days I was working in a project where I had to test the performance of an
application what is made of Google Web Toolkit and I had HP Loadrunner 12 in my hand.

At first it seemed a big challenge to me as the technology was new and there were very few
availability of help.
Among everything the clearest one was this thread ->
http://claudihome.com/html/LR/WebHelp/Content/VuGen/t_GWT_DFE.htm

About Loadrunner: HP Loadrunner is an industry standard load testing tool that gives an entire
solution to record test script for multiple type of applications, performs the load execution and
in the end provides various graphs measuring different parameter to analyze the application’s
performance. The capability of the tool is much vaster than its description or other comparative
tools like IBM RPT or Apache Jmeter.

About GWT: Google Web Toolkit is a free open source platform that is made of Java but
serves against JavaScript!! It provides a set of core Java APIs and Widgets for client side
development to build Isomorphic Web Applications. GWT allows to write AJAX applications in
Java and then compile the source to highly optimized JavaScript that runs across all browsers,
including mobile browsers for Android and the iPhone.

GWT is supported from Loadrunner 11.5 onwards. It is also supported in IBM RPT and
Apache Jmeter. Although Jmeter is a free tool but for GWT compatibility it needs an external
plugin (ubik-jmeter-gwt-plugin.jar) what gives a free trial product key only for 10 days.

To start with GWT scripting first we need to understand what actually happens when a
GWT request is made –
Modification in header: It adds two specific request headers to recognize the client.
Modification in body: It encodes the request body in an unreadable format for optimization.
1. Set the environment:
• Get the information from the development team that in which Java version the
 application is compiled.
• LR 12 uses jre 1.5 as its default java runtime environment.

• There is no way in LR Web – HTTP/HTML protocol to explicitly mention a new jre neither
you can replace LR’s default jre folder from Program Files without proper privileges.

• But to get rid of it you can define the CLASSPATH environmental variable and include
all possible locations from where you feel that any class can be used. At least in my
case it worked-

.; "C:\Program Files\Java\jdk1.8.0_31\*"; "C:\Program Files\Java\jdk1.8.0_31\lib";


"C:\Program Files\Java\jdk1.8.0_31\jre\lib\*"; "C:\Program Files\HP\LoadRunner\cl
asses\*"; "C:\Program Files\HP\LoadRunner\classes\*"; "C:\Program Files\HP\LoadRun
ner\classes\srv"; "E:\RI280450 - ABS2000\ESP\ESP_LR_Scripts";

• The “.” specifies the current folder.



• In E:\ RI280450 - ABS2000\ESP\ESP_LR_Scripts folder, the .war file (the compiled
application archive) file is placed.

2. Configure recording options:
• You can set the GWT specific recording options after recording the script and
then regenerate it or you can do it before and then record the script.

• With other best practice recommended recording option do set checked for x-gwt-
permutation header.
• Now the most vital part is to create the Data Format Extension (DFE) that will decode
the request body in XML format.

• First collect the latest .WAR application archive file from development team and place it
 in an accessible location.
• Now declare a new DFE chain name and click OK –

• Associate the .WAR file with the chain –


i> Select the DFE name-> Click Add Chain-> Select GWT Extension-> OK

ii> In the next window Click on Add File-> Browse the .WAR file-> OK
• Enable the DFE Chain for Code Generation –

3. Check the script:


• Before applying the recording option changes the GWT request looks like this –








• After applying DFE the GWT request will look like this –
• Make sure x-gwt-module-base and x-gwt-permutation headers are present
before web_convert_from_formatted function.

• If these headers are not present do copy the value from the generation log and add
in web_add_header function.

4. Parameterization & Correlation:


• Parametrization is easy after the request is parsed in XML. Do follow the normal
procedure selecting the value that is to be parametrized.

• Correlation is a bit tricky as the page we see in the browser is not the actual response
but generated by JavaScript.

• To get the actual response go to snapshot view of the request.
View menu-> Snapshot view (Ctrl+Alt+P)

• The other way is to correlate the whole response without any boundary and obtain
the actual value boundary.
5. Error Resolution:
 • GWT Format Mismatch: Check the headers are properly present.
 • HTTP 500: Check the headers are properly present. If any request is recorded with
 .cache.html extension, comment it.
 • Script Regeneration Failed: Make sure the environment is properly set. Make sure the
.WAR file is the latest one.

THANK YOU

You might also like