Load Testing GWT-RPC applications with UbikLoadPack Plugin for JMeter
Context
You have a GWT-RPC (Google Web Toolkit RPC) based application and you want to load test it using Apache JMeter
But the problem you are facing is that GWT-RPC protocol uses an optimized format which makes it hard if not impossible to:
- Understand the content of requests and responses
- Extract data and variabilize it to make the test realistic
Let’s be clear enough, testing without doing those 2 things would be similar to making all users search for the same product or edit the same content, in a word if you are going to do it without it don’t do it !
Here is an example of GWT Request:
7|0|5|http://www.geniuswiki.com/gwtpage/|0624EB2D417666E544D36FBFBA6E1831| com.edgenius.wiki.gwt.client.server.PortalController|getDashboard |Z|1|2|3|4|1|5|0|
And a response:
//OK[14,16499,13,12,0,9,9,0,0,0,0,9,9,11,10,0,0,0,0,9,9,8,6,7,6,1,5,4,3,2,2,0,1, ["com.edgenius.wiki.gwt.client.model.RenderMarkupModel /3648883652","java.util.ArrayList/4159755760","com.edgenius.wiki.gwt.client.model.MacroModel /453643445","portal","java.util.HashMap/1797211028","java.lang.String /2004016611","showlogo","true","","com.edgenius.wiki.gwt.client.model.TextModel /1981019746","<br />","demo gwt","java.lang.Integer/3438268394","demogwt"],0,7]
So you’re stuck and wonder how to do this.
Hopefully, You’re in the right place, we have the answer to your request 🙂
In this tutorial, we will show you how to:
- record a GWT RPC scenario using [www.geniuswiki.com Genius Wiki] site
- Extract some data and variabilize it
- Use it in you requests
Plugin Setup
Follow this guide:
UBIK LOAD PACK GWT PLUGIN
Or watch this video:
Recording
To record the scenario, we will use the Standard JMeter HTTP(S) Test Script Recorder.
UBIK GWT Plugin seamlessly integrates with Standard JMeter and works behind the scene to translate GWT-RPC requests to readable XML format.
Recording setup
If you don’t want to read what’s below, you can also watch this video:
We will create a very simple Test Plan to record the scenario. For this we setup:
- HTTP Request Defaults (Server Name or IP : www.geniuswiki.com)
- HTTP Header Manager
- HTTP Cookie Manager with default configuration
- User Defined Variables that contains some data that we want JMeter to automatically change to variables:
- X-GWT-Permutation : This is the permutation’s strong name. This id is guessed by looking http://www.geniuswiki.com/gwtpage/<ID>.cache.html file included in the main page or by one of the subsequent requests which URL ends with <HEX>.cache.html.
- X-GWT-Module-Base
- wordToSearch : test (we will search for this text during recording)
- login : The login we will use on the website
- password : The password we will use on the website
And we add an HTTP Test Script Recorder which we configure this way, note it is standard JMeter configuration:
Finally, we configure Firefox to point to the JMeter Server proxy:
Recorded Scenario
Scenario has 5 steps:
- Display Home Page : www.wikigenius.com
- Click on Login button, popup is opened, Enter login, password and click on Login button
- Enter test in upper right input text and enter, search results are displayed
- Click on one search result
- Click on Logout
Recording result
This is what JMeter has recorded, we will zoom on Sample which is the click on Search for test:
Let’s see what our plugin displays in View Result Tree element:
A new View ULP_GWT-to-XML appears at the bottom right of View Result Tree element with a GWT Tab:
Request Tab displays:
- The original raw Request in GWT-RPC encoded format
- The XML created by our plugin to ease variabilisation and readability
Response Tab displays:
- The XML created from the GWT-RPC response by our plugin to ease variabilisation and readability
Another View ULP_GWT+XPath Tester appears at the bottom right of View Result Tree element. It lets us test XPath expression to extract <contributor> content, you can see:
- The XML translated GWT-RPC response in the top panel
- The XPath expression in the middle
- The extraction result in the bottom panel
Finally let’s see what our plugin has recored for one sample:
As you can see, instead a GWT-RPC format, plugin has set the XML translated request and by the way test has been replaced by ${wordToSearch}.
Extract and variabilize
To show how extraction and variabilization works, we will:
- Extract from search response (Sample 340 /search.rpcs) one of the contributor ids
- Inject it in the Sample 344 /page.rpcs which is the request that handles the click on search results
To extract the contributor element content from the GWT-RPC response:
- we add an ULP_GWT PostProcessor which will store in result variable the GWT-RPC response translated to XML, it will also check response is from expected type com.edgenius.wiki.gwt.client.model.SearchResultModel
- we add a standard XPath Extractor which will use the result variable, apply the XPath expression //results/com.edgenius.wiki.gwt.client.model.SearchResultItemModel/contributor to extract the id of the link to click and store the result in resultToClick variable. Note you could also use a Regular Expression Extractor to do that.
- we can now use ${resultToClick} in the next GWT-RPC request
The final touch
Running this plan will fail because XML requests will be sent instead of GWT-RPC formats.
To fix this, we add ULP_GWT-PreProcessor, this element will do the MAGIC which translates XML format to GWT-RPC one.
You’re done
Thanks to ULP GWT Plugin, in less than 10 minutes, we have variabilized a test plan using our knowledge of Standard JMeter and 4 additional Test elements:
- ULP_GWT PostProcessor to transform GWT-RPC response to XML and store it as a variable
- ULP_GWT-PreProcessor to transform XML translated GWT-RPC requests to GWT-RPC format
- ULP_GWT-to-XML view integrated in View Results Tree element to view and debug Test Plan
- ULP_GWT+XPath Tester view integrated in View Results Tree element to view and test XPath expressions on XML translated responses.
As you can see, our plugin is fully compatible with Standard JMeter elements so that you can reuse all the power of JMeter.
Plugin is compatible with versions Apache JMeter starting from 3.0 up to current 5.3.
About the author:
Philippe M. works as an Architect and technical expert for Ubik-Ingenierie where he leads among other things the development of UbikLoadPack a set of Commercial Plugins for Apache JMeter allowing to load test different protocols like HLS, MPEG-DASH, Smooth Streaming, GWT or Java Serialization.
Philippe is a committer on the Apache JMeter project and member of the PMC since October 2011.
Finally he is a co-author of a book on JMeter called Master JMeter: From Load Testing to Devops.
About UbikLoadPack:
- Ubik Load Pack is a set of Enterprise Grade plugins for Apache JMeter used by Big players
- We provide professional services for Load Testing
- Learn more about our gwt plugin
- Get a Free trial
3 Comments
Comments are closed.
Recent Posts
- How to setup ads insertion on video streaming with AWS Services 26 November 2024
- UbikLoadPack Video Streaming Plugin 10.0.0 26 November 2024
- UbikLoadPack Video Streaming Plugin 9.1.6 26 November 2024