So I am doing a Load Test and I see you can dynamically assign dynamic Targets
In my case this is sessionIDs from a .csv file I Bound to the test already.
This is working good so far, SessionIDs are replaced in the Request Headers succesfully.
There are instances where we send the sessionID in the Request Body, instead. I see I can manually edit the Post Data in the "Edit User Profile" popup, but I would like to make it dynamically choose a sessionID from my .csv file
I also tried adding a Custom Dynamic Target until I realized These affect Response(!) Body rather than Request(!) Body.
So my Question is:
Is there a way to tell TestStudio to dynamically replace Values in the Request Body?
Plus is there an easy way to bulk-do it or globally Change it? Because I would like to avoid doing this hundreds of times over.
Thanks and Kind regard
4 Answers, 1 is accepted
It seems that you have tried out most of the options, which Test Studio provides to parameterize the load testing user profile.
What you need to cover the described requirements are the dynamic targets and as these may be quite complex, I will provide some further information on the topic for you.
The general case for a dynamic target is to pass some dynamic information generated from the server from one request's response to the next request's body. In Test Studio there are automatically detected targets, which, unfortunately, does not always cover the needs of the specific requests and client-server communication.
Therefore, we have developed and implemented the Custom dynamic targets, which allow you to customize any user profile as per its specifics.
Then, here are some notes about the custom targets -
- one of the most important is that such target is also taking specific value from the a request's response to provide it to the next request's body.
- When creating a custom target, you can choose where to take the value from - the response body, headers or cookies.
- Next is to configure where to send that value - you can choose between Query Parameter, Header, Cookie, POST data, URL.
- The custom targets can be also used to data drive any value in certain request. Even if the certain value is not returned in any response, you can add a custom target, which gets any value from a response, but defines the destination. Then, data drive that value.
The above topics seem to cover your first query in regards the dynamic customization of a user profile. In regards your second query, I have to admit that there are no global values you can define and bulk edit these. Basically, if a request needs 4 dynamic values - in the post data, 2 query parameters and a cookie, for example, you need to add four different dynamic targets to pass these to the request.
I hope this information will help you in adjusting the user profile for your load test. Of course, I remain available the continue the discussion and if you need to, it will be very helpful if you can share a sample load test to use as an example.
Thank you in advance for your time.
Our thoughts here at Progress are with those affected by the outbreak.
I am also facing a similar challenge:
The REQUEST body of /POST login/ has the user name & password which I want to Data bind on my Load test, so that I can have a list of users on the Data Source.
The problem is that since the Custom Dynamic Targets do not allow me to use Data Binding on the Request body, as of 2021, is there any workaround for this?
sadly I didn't manage to dynamically bind data to the Request Body. What I did was this:
- I recorded my User Profiles with Fiddler
- Then I unzipped the .saz archive and edited the sessionIDs in the raw Fiddler data (notepad++ replace all)
- Zipped it back up, changed ending to .saz
- Imported that forged .saz archive as user profile in Test Studio
That is not a very elegant solution as basically all my users were sharing the same sessionIDs at that point, but at least the responses didn't default to error codes because their session was invalid. It got the job done ;)
Hopefully Elena or some other Telerik staff can present a better solution. Until then maybe this sparks an idea in your head.
Hi Ben, Alex,
Thank you for sharing your thoughts on the topic in this thread.
I wanted to step in and provide some additional notes as I have the feeling that the provided details do not address your doubts.
When defining a dynamic target in Test Studio you are using one source step, from which response is the dynamic data taken, and one destination step, which defines where in the request to place the changing values - replace the URL for redirects, replace a query parameter, set a cookie, replace a value from the POST data. All options for the destination step concern how the request will be built and sent to the server, and are not related to its. response.
Next topic is data driving a load test in Test Studio - this is only possible through the dynamic targets. The scenario, which seems to be bothering you is how to data drive some data in a request, which is not defined through dynamic targets from the previously executed steps.
If I have understood correctly, then the option is to use dummy custom dynamic targets. These should be set to pass any data to the request, which body you need to parameterize. Once these dynamic targets are bound to the external data, which provides the correct values, the test should run as you expect it. Of course, if there is no is external data connected, which contains valid data, the load test execution will fail.
I hope that this brings some further understanding for the case. I remain available to continue the discussion, though.