In older versions, Load Tester provided a simple interface for modifying the URI portion of an HTTP request. For example, you could add a query parameter or a path segment by adding it directly to the request line in the Edit HTTP Request-line/URL dialog.
In Load Tester 4.2, this process has been made slightly more complex but vastly more powerful. We’ll start by manipulating the URI field directly. To do so, select the specific transaction you wish to edit, then select the Fields View, then choose “Customize” from the “Choose customization” drop-down menu in the upper right corner of the Fields View. At the top under “Field Types”, uncheck the box labeled “Filter fields by type”, then hit Ok.
This will expose all available fields for the transaction, including the base URI field that contains the path segments (as a simple example: “/css/style.css”). Edit that field by clicking in the Datasource column.
This will bring up the Edit Field dialog. Select the Datasource “Text Constant” from the drop-down menu, and then add your query parameter to the end of the string, something like this:
Then hit the Ok button, and this static query parameter, “1” in our case, will be submitted in the next replay and for every test case iteration.
If you need the query parameter to come from an extracted user variable or a data set, then set up the field with the Text Constant datasource first using just:
/css/style.css?q=
Then, select the Concatenate datasource, hit the green plus-sign button, and add on your user variable or dataset datasource. Note that query parameters MUST be URL encoded, so if you have characters in your query parameter that are not permitted, you’ll need to select the Transform datasource, select URL Encoded, and then choose your User Variable or dataset datasource.
At the end of such a configuration, having set up an extractor for the user variable “test” in a previous transaction, your Edit Field dialog for the URI field will look something like this:
With this method of request modification, virtually anything can be inserted into the request – datasets, user variables, text constants, or combinations of these. Note that there are virtually no restrictions left on what you can insert into the request, and that invalid requests may cause unexpected results; for example, if you include a line terminator in your URI, expect Load Tester (and the web server) to be very confused.
Happy testing!
Matt Drew
Web Performance Test Engineer