Use framework parameters to automatically search for dynamic parameters
This tutorial will show you how to automate dynamic parameter handling using framework parameters.
To get the most out of this tutorial, it is recommended to read the following tutorials beforehand:
-
Handle an application dynamic parameter, in order to understand the steps involved in defining a variable extractor.
Understand the problem
The HTML pages generated by applications usually contain dynamic elements, that is to say components whose values vary from one call to the next. Typically, these include unique identifiers that cannot be replayed "as is", and which must be managed individually.
When dynamic parameter handling fails:
- requests may show an error (typically,
Error 500
) when checking the Virtual User validity; - the Virtual User displays an unexpected behavior (entries not created in the database for example).
NeoLoad automatically handles the most common parameters, such as the Framework .Net __VIEWSTATE parameter. However, NeoLoad cannot automatically handle parameters that are specific to an application. They need to be handled individually, that is to say by placing an extractor on the value returned by the server and injecting the extracted value into the appropriate requests.
NeoLoad provides the necessary tools to handle a dynamic parameter manually. For more information, see Handle an application dynamic parameter.
Example
Handling a dynamic parameter manually involves extracting the value from the server response using a Variable Extractor and replacing it in the appropriate requests. In the example, you will use the extractor to declare a framework parameter.
For example, you can use the variable extractor to extract the id
parameter from the server response.
The parameter you are looking for appears in numerous requests, which is why the search must be systematized. The multiple occurrences of the id
parameter in the scenario (identified by the blue flags ) can be seen in the Request parameters table.
How framework parameters work
By adding a rule to the framework parameter, you can handle all the occurrences of a parameter automatically.
When searching for dynamic parameters NeoLoad uses the rules defined for the framework parameter to automatically create variable extractors in the appropriate requests. Furthermore, NeoLoad automatically injects the corresponding variables into the parameters of the requests that require the variables.
The dynamic parameter search is carried out:
-
at the end of the recording, using the Post-Recording wizard, or
-
using the Virtual User Dynamic Parameter Search wizard. Select the appropriate Virtual User in the Design > Virtual Users tab, then click on the Search button to launch the wizard.
Create a framework parameter
There are three ways to create a framework parameter: manually, using a variable extractor set on a request, or using a variable extractor set on a parameter.
To create a framework parameter using a variable extractor set on a request, follow these steps:
-
Create and validate a variable extractor for the parameter to be handled. Then go to the list of variable extractors for the request by clicking on the Advanced button and selecting the Variable extractors tab.
-
Click on the Move as framework parameter button to launch the Framework Parameter Creation wizard.
-
Enter the name of the framework parameter ("id" in this example) and select the framework name (existing or specify a new framework name). Click Next.
-
Set the dynamic parameter replacement policy (automatically preconfigured by default). In the example, NeoLoad has detected that the extracted dynamic parameter is used later on only for the value of the "id" parameter. Click Next.
-
This window allows you to apply the parameters to the requests in the current recording. Click Finish to validate and start the search. The result of the scenario analysis is displayed after the search step.
-
Apply the changes (default option): This will set the variable extractors and inject the variables into the parameters of the appropriate requests.
Access framework parameters
The Framework parameters can be accessed with the Edit > Preferences > Dynamic Parameters command.
Changes implemented in the scenario
To conclude the case study, you just need to check that the changes have been implemented in the Virtual User requests. You can see that the values of the requests id parameters no longer contain the numerical values recorded, but the variables created using the framework.
In place of the value "1251988153222", you now have "${id}".
Remember that you may start a new automatic dynamic parameter search by clicking on the Search button in the Virtual Users tab. Select the Virtual User in the User Paths tree. This makes NeoLoad carry out a new search, including the new framework parameters.