You can use data replacers to replace recorded cookies in requests with variables that contain data extracted from preceding responses or that LoadComplete generates or gets from external files.
|Note:||Make sure that LoadComplete uses real-time cookies; otherwise, it will ignore cookie replacers during scenario simulation.|
To insert data into all requests, select the top-level node in the scenario and switch to the Data Replacers page.
To insert data into an individual request, select the needed request and switch to the Data Replacers tab at the bottom of the page.
Add a new data replacer:
In the Area column, select Cookie.
Note: To replace cookie values, we recommend using the Cookie value in the Area column rather than Header (Path) or Header (RegExp).
In the Expression column, enter the name of the cookie whose value you want to replace with the variable. You can also specify a variable that contains the desired value:
Click and select a variable that contains the cookie name,
– or –
Enter the variable name manually, in the \vVariableName\v or @VariableName format.
If you want to concatenate a variable with another variable or arbitrary data, use the \vVariableName\v syntax:
@VariableName values cannot be concatenated in place.
In the Attributes column, enter cookie attributes (if needed).
In the Variable column, select the needed variable.
Select File > Save from the main menu to save the changes you have made.