A Dynamic Target is a unique parameter or variable used by the application to generate information like a unique user ID or session ID. These values are generated by the web server and sent to the browser, which then later returns that value back to the server, so that the application can match the new request to a previous HTTP transaction. To accurately simulate users via virtual users, it is important to correctly return these Dynamic Targets during the load test execution.
If Test Studio detected any possible Dynamic Targets in the HTTP traffic, a list of those targets will appear after you capture a user profile. In this screen, you can select which Dynamic Targets the load test should use while running the test by checking the box next to the name of the Dynamic Target.
In most situations, you should select all dynamic targets, unless you have a specific reason to deselect a particular dynamic target.
Each dynamic target lists four properties:
- Target: The name of the parameter or variable from the original URL.
- From: The step number of the response in which the target was detected.
- To: The step number of the request in which the target will be used.
- Original Context: The portion of the response URL containing the target.
A typical situation using dynamic targets is load testing an application that provides a unique session ID for each user. In this scenario, the session ID dynamic target may appear in the Dynamic Targets view.
The step whose number appears in the From column will include the dynamic target in its response. Here, it appears in the headers.
The step whose number appears in the To column will include the dynamic target in its request. A special section appears in the Request tab indicating that this response is bound to a dynamic target.
Based on the HTTP traffic there might be targets which are not detected by Test Studio as dynamic but still these will be required to accomplish meaningful scenario. Or any of the auto-detected dynamic targets is not listed for transfer to a desired request.
To handle such scenarios Test Studio implemented the ability to add Custom Dynamic Targets. The Custom Dynamic Targets are available in the Choose Dynamic Targets view where all auto-detected are listed as well - once a user profile is captured or opened to be modified click the Choose Dynamic Targets button.
Once any custom targets are added to the user profile these will be displayed under the list with all auto-detected dynamic targets. To add a custom dynamic target use the Add Dynamic Target button.
- Step: Step to take the target from. Any step which contains a HTTP request can be selected. The Think time steps are filtered out and not displayed in the dropdown.
- Response: Which part of the HTTP response to be used - Body, Headers or Cookie. Select the necessary part of the HTTP response and verify its content.
- Content: Displays the content of the selected response part.
- Search Type: The type of search to be used in the content of the selected response - FullText, Regex, JSON, XML. Select any of the provided options to filter the necessary value from the response.
- Starts after/before|Regex|JSON path|XPath: Provide the search query to locate the desired value in the response.
- Search Result: Show the reuslt based on the search query.
- Current Value: Display the current reuslt based on the search query.