Google Web Toolkit: Handle external libraries

This tutorial describes how to design a Virtual User containing Google Web Toolkit requests. It introduces you to the Post-Recording Wizard, which is used to instruct NeoLoad how to decode the GWT requests. If you do not have all the required files during the recording, this tutorial explains how to repair GWT requests that could not be decoded.

To gain the most from this tutorial, it is recommended to read:

Understand the context

In the same way that it allows HTTP requests to be defined and tested, NeoLoad also provides a method of load testing GWT Web applications. GWT requests are similar in many ways to standard HTTP requests. This means that all the NeoLoad features available for testing HTTP requests can also be used for GWT requests, for example the use of variables or defining validations on the server response.

Record GWT requests

To record GWT requests, see Record a test scenario.

To recap, the GWT-RPC protocol allows the exchange of custom Java objects. If the classes are missing for the sent Java objects, the request binary data cannot be decoded for conversion to XML. The following procedure explains how to resolve the problem of missing Java classes.

With GWT, an object is said to be serializable when it implements the java.io.Serializable interface (from GWT 1.5 onwards) or the com.google.gwt.user.client.rpc.IsSerializable interface (for earlier versions).

Prerequisites

For NeoLoad to be able to decode the GWT requests and responses, the following elements are required: the RPC services client interfaces, the objects exchanged between the server and client and the other referenced classes.

Process

To record GWT requests, follow these steps:

  1. When you close the browser, the Post-Recording Wizard is displayed.

  2. Select the JAR files containing the missing serializable Java classes.

  3. Repeat the operation as many times as is necessary.

  4. When all the required JAR files have been declared, a confirmation screen is displayed.

For more information about the next steps in the wizard, see Post-recording wizard.

Fix a GWT request post-recording

The JAR files required by a GWT request may be declared at any time.

Here, the request selected in the Virtual User requires Java classes that are not available. This fact is revealed by several indicators:

  • The request icon in the Virtual User.

  • The request contains unexpected characters, instead of XML.

  • A link (in blue) indicates that the GWT Java libraries for this request are missing.

To fix a GWT request post-recording, follow these steps:

  1. Click on the link prompting you to declare the required GWT Java libraries. You may also use Edit > Preferences > Project Settings > Libraries Manager > Google Web Toolkit.

  2. Click the + (plus) button to open the file explorer. Select the JAR file to declare.

  3. If the JAR file loads correctly, a dialog box confirms that the GWT library has been successfully declared.

  4. The loaded JAR files appear in the list and a message informs you that the process was successfully completed. Once the request is correctly decoded into XML , it appears in XML format.

  5. If the request still has not been converted to XML format, it means that some required JAR files still have not been declared. Repeat the operation as many times as is necessary.