Reputation: 8458
I'm using Visual Studio 2010 for recording some web tests. I intend to build some load tests using these web tests. Most of the pages of the website that I'm targeting have lot of other resources like js, css files and images. When an actual user is browsing the website, these resources are downloaded for the first time and then cached by the browser. The GET requests for downloading these resources are captured as DependentRequests
in WebTestRequest
I want to simulate this in my load test. When the same virtual user sends second request to the server, the DependentRequests
should not be sent to server. By setting WebTestRequest.ProcessDepedentRequest
to False
we can turn off sending the DependentRequests
to server. But this would turn it off even for the first request, which I don't want.
Is there any way to achieve this?
Thinking further, when I have a load mix of step type where in I start with 10 virtual users and after every 2 mins I add 10 more virtual users. Now after 2 mins, I would have 20 virtual users. At this point, are all 20 virtual users treated as new users hitting my website for the first time or 10 of these (from the first time slot) are hitting my website second time and remaining 10 hitting my website for first time?
Upvotes: 1
Views: 1423
Reputation: 11
"Regarding virtual users: in the LoadTest Run Settings, there is a setting called "Percentage of New Users". If this is set to 0, every new test iteration will be run by a new virtual user, and so their simulated cache will always start out empty."
It's actually other way around. If you specify "Percentage of New Users" as 100 that means that every new iteration will run by new user.
Upvotes: 1
Reputation: 3548
Visual Studio Load Tests already automatically simulate browser caching behaviour: dependent requests are only fetched once for a virtual user.
Regarding virtual users: in the LoadTest Run Settings, there is a setting called "Percentage of New Users". If this is set to 0, every new test iteration will be run by a new virtual user, and so their simulated cache will always start out empty.
If it is set to 100, every new test iteration will re-use an existing virtual user if possible, so only on a virtual user's first test iteration will the simulated cache be empty, and then for the remainder of test iterations the simulated caching will prevent the re-fetching of dependent requests.
Upvotes: 2