HTTP(S) Load Test may require you to use some variable data that will be used while testing your URL.

For example, you can test different types of form submit such as registration forms, advanced search form, filter forms, etc. by simulating an HTTP(S) request with dynamic parameters. To accomplish this you need to set up Context Parameters for the request and provide a list of dynamic values for these parameters in the test scenario. You can set up context parameters for the URL, Headers, request body (for Post, Put, Patch request types) and for the custom script in the Prepare script field.

Use the following syntaxis to specify a context parameter value: 

context.<parameter value>

Context Parameter names must be identical to names of respective web elements you want to test with dynamic variables. The parameter name is case sensitive. 

To specify a parameter name in the request, Inspect the respective element code and copy the “name” attribute value. 

Let’s say, we want to test submitting a website registration form with unique field values. First, we need to create an HTTP task with the corresponding Post request. Then we need to add parameters for the form fields in the request body (Post Data) and convert them to context ones. 

To add a new parameter:

  1. Select Post in the Request Type field.
  2. Expand the Post Data field and click the Detailed toggle, then click Add Parameter.
  3. In the Parameter name field, type in the form’s field name how it appears in the respective element code.
  4. To convert the parameter value to context one, point to the Value field and click the gear icon. 
  5. In the Edit Value window, select Dynamic and specify the parameter value using the following syntax: context.<value>. Click Done.
  6. To specify a default dynamic value for a context parameter, click the actions menu button   on the Task Configuration sidebar and click Manage Context Parameters. Click Done to finish.

On the picture below Name and Pwd post parameters are now going to take the value out of the Context Parameters (variable) named “login” and “password” respectively.

When the task has been saved, you can specify the list of Dynamic Variables (Context Parameters values) in the test scenario. See Uploading Dynamic Variables to the Test Scenario for more details.