How To Manually Modify HTTP Requests in Load Tester 4.2 - Web Performance
Menu

How To Manually Modify HTTP Requests in Load Tester 4.2

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.

 

The old Edit HTTP Request-line/URL dialog

The old 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.

 

Clearing the Field Filter

Clearing the Field Filter

 

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.

 

Double-click the Datasource Column

Double-click 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:

 

Adding a Query Parameter in the Text Constant Datasource

Adding a Query Parameter in the Text Constant Datasource

 

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.

 

Adding a URL-encoded Transform of a User Variable datasource

Adding a URL-encoded Transform of a User Variable 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:

 

Add a Transform, URL Encoded, User Variable "test"

Add a Transform, URL Encoded, User Variable "test"

 

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

Add Your Comment

You must be logged in to post a comment.

Resources

Copyright © 2024 Web Performance, Inc.

A Durham web design company

×

(1) 919-845-7601 9AM-5PM EST

Just complete this form and we will get back to you as soon as possible with a quote. Please note: Technical support questions should be posted to our online support system.

About You
How Many Concurrent Users