Form submissions represent a common use case for performance tests. If your JMeter test needs to automatically fill out form fields from a data source, this is classically done with extractors and variable substitution. Depending on the number of fields in your form and the structure of your web page, this can become complicated. To simplify this process, we will show you how to use the HTTP Form Manager plugin. This component allows you to intuitively specify form data by automatically matching variables to named fields.
Configuring the HTTP Form Manager
To add the HTTP Form Manager to your test plan, right click on the test plan tree and find the component under “Preprocessors”:
Configuration for the HTTP Form Manager is straight-forward and minimal. For most instances, the following default configuration options should suffice:
Populating HTTP Requests with Form Data
The HTTP Form Manager will apply itself to any applicable HTTP Request instances that exist within the same scope. In the following example we are substituting a username and password for a login form, matching named fields with variables (e.g., from an instance of a CSV Data Set Config).
For the HTTP Request to correctly submit form values, you will need to ensure that the “multipart/form-data
” option is selected as shown above. The parameters in the table will be substituted into form fields by name, such that the “username” field will be matched to the following example HTML code in the target application page:
<input id="uid" type="text" name="username" value="" />
Did you know that RedLine13 offers a full-featured, time-limited free trial? Sign up now, and move your JMeter testing into the cloud today!