The Java Record Replay protocol enables full VuGen functionality when recording a script on a Java application or applet. VuGen creates a script in pure Java and enhances it with HP LoadRunner API Java-specific functions.
In order to successfully record a script, you must install JDK on the VuGen machine before recording a script. JRE alone is insufficient. Ensure that the classpath and path environment variables are set according to the JDK installation instructions.
After recording, you can enhance or modify the script with standard Java code using JDK libraries or custom classes. VuGen utilizes the standard Java compiler, javac.exe, to compile the script. Once the script is successfully compiled you can incorporate it into a LoadRunner scenario or Business Process Monitor configuration.
Supported Java Communication Protocols
VuGen supports a variety of different communication protocols for Java applications:
- RMI: For information on the RMI protocol, see Working with RMI.
- CORBA: For information on the CORBA protocol, see Working with CORBA.
- JACADA: For information on the Jacada protocols, see Working with Jacada.
VuGen's built-in support for the Java protocols utilizes hook files to define how different classes communicate with each other. For information on the hook file structure, see Hook File Structure.
By default, VuGen only records client side activity in a script, which then emulates the load on the server. You must edit the hook file to change the actions recorded by VuGen. To manually edit the hook file, see Java Custom Filters Overview.
Note: If you are recording a script that does not use one of the supported protocols (RMI, CORBA, JMS, Jacada), you must define your own hook file otherwise your Vuser script will be empty.
VuGen provides a tool that enables you to convert a script created for Web, into Java. For more information, see How to Convert a Web - HTTP/HTML Vuser Script into a Java Vuser Script.
Note: By default, Java 7 enables the Java Split Verifier. This prevents Java recording in LoadRunner. LoadRunner uses the -XX:-UseSplitVerifier key while initializing the JVM during recording, to disable the verifier. This adaptation does not require any user intervention.