简体   繁体   中英

How do I get Visual Studio Load Test to show one test per user?

I am tasked with creating load tests for a web application. I'm using Visual Studio 2017's Web Performance and Load Testing tool. I created the project, created a Web Test script, then created the Load Test scenario. What we want is to test running the same script with various concurrent user counts (10, 20, 30, etc.).

Everything runs fine, but there is one small issue. No matter how many concurrent users I set up to run the test, the result page shows only one test was run. While it is true that I only ran one test, it was run N times, where N is the number of concurrent users (I have it set up so that each user runs it once and then stops). I'd like for the final report to reflect this.

The only reason I expect this is possible is that we have a report from an old test that someone ran, which shows 40 Total tests for 40 users, and another result showed 30 Total tests for 30 users. They somehow got it to show one test per user. Unfortunately, all I have is screenshots of the result page; I don't have access to the actual tests or settings (it's a long story, but they are gone, and so is the person who made them). So now I'm basically stuck trying to reverse engineer how they did it.

Here are my settings for the load test:

  • On-premise
  • Test iterations: 1
  • Think times: Normal distribution
  • Load Pattern: Constant Load: 40 Users (I change this for different loads)
  • Test Mix Model: I thought this would be it, but I have tried all 4 of these, and they all just show 1 test run.
  • Test Mix: I add my test here. I thought about trying to add the same test 40 times for 40 users, but it only lets you add it once.
  • Network Mix: LAN
  • Browser Mix: IE11
  • Counter Sets: Nothing (default)

Does anyone have any idea how to make it do what I am trying to do?

The "Test iterations" field in the "Run settings" gives the total number of tests to be executed, provided the "Use test iterations" is set true, otherwise the test runs for the time given by the "Run duration". Setting "Test iterations" to 1 (ie one) means that the test will be executed once.

The "Test iterations" gives the total number of tests to be executed. If you want 30 virtual users and want each to execute 4 tests then you would need to set 30*4 = 120 iterations.

The "Scenario" properties include a "Maximum test iterations", this should be left at zero so it does not conflict with the values in the "run settings".

To ensure that each simulated user only executes one test, set the "Percentage of new users" property in the "Scenario" to 100. See "The Effect of Percentage of New Users" section of this page .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM