Playing Back a Session
Once you have recorded a session with your application, you can use the Playback command-line tool to simulate users accessing the application. This Java tool is part of the PlaybackManager project, which must be compiled for the tool to exist.
To play back a recorded session:
- Add the following directory to your CLASSPATH environment variable:
- In a separate shell, start the application as you normally would (do not use the -WORecordingPath flag here). When you start the application you can use adaptors or direct connect.
- Start the Playback java tool by entering a command similar to the following:
NEXT_ROOT/Library/WebObjects/Applications/PlaybackManager.woa/WebServerResources/Java
java com.apple.client.playback.Playback -r /tmp/tape1.rec
The Playback class must be found in the Java classpath. When the PlayBack Manager project has been compiled, the Playback tool bytecode is in the subdirectory Playback Manager.woa/WebServerResources/Java.
Alternatively, you can explictly give the class path on the command line, as in this example:
java -classpath ".:$NEXT_ROOT/Library/WebObjects/Applications/PlaybackManager.woa/WebServerResources/Java:`javaconfig DefaultClasspath`" com.apple.client.playback.Playback -r /tmp/tape1.rec
The Playback tool plays the recorded session repeatedly until you explicitly stop it (for example, by pressing Control-C in a command shell window). You can run several instances of the tool at the same time to put more load on the server. To manage multiple instances it's better to use the Playback Manager application.
If you want, you can specify other options of the Playback tool. The following list describes these options:
-p adaptorPath
Sends requests using the specified adaptor path instead of the recorded URL. For example, suppose you recorded a session using a Netscape server whose cgi-bin directory is named cgi-bin and you want to play it back using the Microsoft Internet Information Server, whose cgi-bin directory is named Scripts and whose adaptor is named WebObjects.dll . Your adaptor path is /Scripts/WebObjects.dll.
-diff percents
Sets the percentage difference between received and recorded response sizes (the default is 5%).
-help
Here is an example of a command beginning a playback session using direct connect:
java -classpath com.apple.client.playback.Playback -d -h mymachine -r /tmp/tape1.rec -port 3456 -diff 20
Additional information on the Playback Manager can be found in NEXT_ROOT /Library/WebObjects/Applications/PlaybackManager.woa/Resources/ReadMe.html .
© 1999 Apple Computer, Inc. (Last Updated 25 August 99)