The variable extractor extracts a string from the server's response to the request and assigns the string to a variable. The variable extractor features two operating modes, simple and advanced. In simple mode, the user defines the string to be extracted; in advanced mode, the user can define more complex extractions using regular expressions.
Definition (Simple mode). Used to define the extractor.

Variable name. The name of the variable automatically created to contain the value extracted.
Extract the value from. Extract the value from either the body of the server response, the headers of the server response or the content of a NeoLoad variable. Extracting a variable from the content of another variable, allows to extract a content with several steps. First extract a part of the response based on a regular expression, then use another regular expression to extract a part of it.
![]() | Note |
|---|---|
The extractors are ordered and executed in the definition order. You can reorder the extractors using the arrows buttons. |
Starting with. The phrase in the server response appearing immediately before the value to be extracted.
Followed by. The definition of the string's main body. The extracted string is the concatenation of all the parts selected for extraction.
Ending with. The phrase in the server response appearing immediately after the value to be extracted.
Occurrence to extract in the page. If the definition is matched more than once, select the occurrence to be used. The default value is 1 (use the first occurrence) but you can choose to use a random occurrence or all occurrences (useful with loops).
If you choose to process all the matched occurrences, the following variables are automatically created:
<VariableName>_matchNr - the
number of occurrences found; can be 0.
<VariableName>_n, where n = 1,2,3
etc - the strings as generated by the value template.
<VariableName>_n_gm, where
m=0,1,2 - the groups matching n
<VariableName> - always attached
to the default value
<VariableName>_rand, random
string from generated strings
<VariableName>_rand_gm, where
m=0,1,2 - the groups matching rand
![]() | Note |
|---|---|
When switching to advanced mode, the definition is automatically converted from simple to advanced. |
Definition (Advanced mode). Extraction is carried out on the server response using a regular expression.

Variable name. The name of the variable automatically created to contain the value extracted.
Extract the value from. Extract the value from either the body of the server response, the headers of the server response or the content of a NeoLoad variable. Extracting a variable from the content of another variable, allows to extract a content with several steps. First extract a part of the response based on a regular expression, then use another regular expression to extract a part of it.
![]() | Note |
|---|---|
The extractors are ordered and executed in the definition order. You can reorder the extractors using the arrows buttons. |
Regular expression to match. The regular expression used to extract the value. Within the expression, the parts to be extracted must be enclosed in brackets (valid: value="(.+?)", invalid: value=".+?"). Please refer to the Regular Expressions Guide for help on regular expressions.
Occurrence to extract in the page. If the definition is matched more than once, select the occurrence to be used. The default value is 1 (use the first occurrence) but you can choose to use a random occurrence or all occurrences (useful with loops).
If you choose to process all the matched occurrences, the following variables are automatically created:
<VariableName>_matchNr - the
number of occurrences found; can be 0.
<VariableName>_n, where n = 1,2,3
etc - the strings as generated by the value template.
<VariableName>_n_gm, where
m=0,1,2 - the groups matching n
<VariableName> - always attached
to the default value
<VariableName>_rand, random
string from generated strings
<VariableName>_rand_gm, where
m=0,1,2 - the groups matching rand
Value template. The template used to construct the value. This is an
arbitrary string containing special elements that refer to groups
within the regular expression (a group is a dynamic portion of the
regular expression set within brackets): $0$ refers to the entire
text matching the expression, $1$ refers to group 1, $2$ refers to
group 2, and so on. Using an illegal group will cause the
extraction to fail and the value
<NL-Illegal-groupIndex> will be set in
the variable during the test. This typically arises when no
brackets are specified in the regular expression to be
matched.
![]() | Note |
|---|---|
When switching to simple mode, the last simple definition is used, since advanced-simple conversion is impossible. |
Examples
Extracting from the server response body. Given the following content: Your order number Mr
Smith is:12345; and that the string to be extracted is
'12345', to be used in a subsequent request.
The variable extractor is defined thus:
Variable name: 'MyVariable' Extract from: 'Message body' Regular expression to be matched: 'Your order number(.+)? is:([0-9]+);' Occurrence within the page: '1' Value template: '$2$' as it's the order number that must be extracted and not the name of the person. Use $1$ to obtain the name. ($0$ would return the complete matched text: 'Your order number Mr Smith is:12345;') Default value: '-1' for example.
Extracting from the server response header:
Extract from: 'Header' Regular expression to be matched: 'MyHeader: (.*)' Occurrence within page: '1' Value template:'$1$'
Test. This tab allows you to test the variable extractor. Enter the
text corresponding to the server response in the text box. The
"value extracted from page" field value contains
the value extracted from the page.

Error. This tab allows the user to define the default value to be used when the definition is not matched in the server response. By default, an assertion fails when the definition is not matched, allowing the request to be treated as an error in the test results.
