Rational Performance Tester: Substituting request content from a file
Preventive Service Planning
With the release of IBM Rational Performance Tester 8.1.1 there is now the built in functionality to substitute request content from a file. Prior to version 8.1.1 this would have had to have been done through the custom code interface.
This example below will demonstrate how to implement this new functionality using a simple test.
The recorded test consists of two pages:
PAGE 1: An ASP based form to upload a file from the file system
PAGE 2: The acknowledgement from the web server that the file was uploaded
In the original recording a text file named ‘RPT1.txt’ was uploaded; the contents of the file are as follows:
“this is the file uploaded during the initial recording”
A datapool was created consisting of one record; the path to the file that will be uploaded at run time
The file in the datapool is called ‘RPT2.txt; the contents of the file are as follows:
“This is the file used in the Rational Performance Tester datapool”
The Recorded test will contain a request (POST) that uploads the file. From an HTTP standpoint the POST request recorded will look something like this:
POST /ToFileSystem.asp HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash,
Content-Disposition: form-data; name="File1"; filename="C:\RPTupload\RPT1.txt"
this is the file uploaded during the initial recording
You can see the file name and text being uploaded
From the Rational Performance Tester Test Editor the POST request contains three data chunk entries (Depending on the application, the number of entries will differ).
The Data Chunk data corresponds to the POST data of the request
To substitute the contents of the data being uploaded first select the request data that you want to substitute and select the Modify button;
Right-click, and then select Substitute > Select Data Source.
Associate the appropriate datapool column for the substitution
When complete, be sure that data content is highlighted in dark green (indicating a substitution is in place) and that the File Contents Substituter is checked
When the test is executed you can verify that the datapooled file was uploaded by looking at the Protocol data view of the Test log
Note: In this example and additional datapool substitution was made for actual file name being uploaded; this would be a standard datapool substitution as opposed to the content substitute outlined in the technote. This may be necessary depending on the specific application under test.
Rational Performance Tester