Overview
After recording a transaction, by default QEngine will mark all the
parameters captured with the parameterization option as "Auto", in which the value for the
parameters will be extracted from the response content of the previous
URL request. If the value of the parameter cannot be extracted from
the response content then the value captured during recording will be
used for playback.
If you want to configure different value for the parameters you have
to parameterize the script so that when replayed with multiple virtual
users, each user uses different data to generate a realistic load on
the server(s).
Depending on the application,
parameterization of source could be from
- cookies
- previous response body
- previous url
- by executing a Javascript
- hidden form elements
- random value or
- from an external source such as database or CSV.
The advantages of using parameterization
in the script are as follows:
Handling
Get/Post Data
Identify the category under which each of the Get/Post Data or
URL parameters fall such as
Constant
Constant type parameters do not
change values between a recorded session and a replay session. The
values recorded can be used as it is for replay.
Dynamic
Dynamic parameters requires that their
values be obtained from the response of the previous request. The
parameter value can be extracted from one of the following:
|
Parameter Value Extracted From
|
Description
|
|
Cookie
|
Fetch parameter value from the Cookie Set in the response
header.
|
|
Element
|
Fetch parameter value from an element attribute value of a
hidden form element. For example <input
type="hidden"
name="jsessionid"
value="QE1469">
use the element attribute value for parameter.
|
|
Text (Response Body)
|
Fetch parameter value from the body of the response.
- Between configured prefix and suffix
text.
- Extract text using Regular expressions.
For example to extract sessionid
from the below html you use
Regular Expression: [\s\S\n\r]*?sessionid=
Suffix: >
<HTML>
<TR><TD>Server Configuration </TD>
<TD><A
HREF=serverconfig.html?sessionid
= 810> Config
</A>
;</HTML>
|
|
Javascript
|
Fetch cookie or parameter value from the specified
Javascript.
|
|
URL
|
Fetch cookie or parameter value from the previous URL for
the given prefix and suffix text.
|
Dataset
Parameters that need unique data for each
use (such as user login
and passwords) and that are fetched from any external
datasource such as Database or FLAT file
or XLS file fall in this category.
For example, when testing a Web
application that contains a login
page, "parameterization”
lets you use a different login
name and password for each virtual user (dynamic substitution of
values). There’s no need for each User Scenario to contain a separate
script that performs the task of logging in.
Auto
In Auto type parameters values will be extracted automatically from the
response
content of the previous URL response. In this QEngine will match the
parameter name with the form field name in the response content.
Matching form field values will be substituted for the appropriate
parameter. If the parameter name cannot be matched to the form field
names then the parameter value will be substituted with the value
captured in the recording.
Parameterizing
Get/Post Data
Parameterization
of Get/Post Data is configured using the Parameterization
screen invoked by
clicking the HTTP Parameters link adjacent to the recorded
transaction in the load test screen. To know the detailed steps, please
refer to the next topic.