简体   繁体   English

如何获得Visual Studio负载测试以显示每个用户一个测试?

[英]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. 我的任务是为Web应用程序创建负载测试。 I'm using Visual Studio 2017's Web Performance and Load Testing tool. 我正在使用Visual Studio 2017的Web性能和负载测试工具。 I created the project, created a Web Test script, then created the Load Test scenario. 我创建了项目,创建了Web测试脚本,然后创建了负载测试方案。 What we want is to test running the same script with various concurrent user counts (10, 20, 30, etc.). 我们要测试的是运行具有多个并发用户数(10、20、30等)的相同脚本。

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). 确实,我只运行了一个测试,但它运行了N次,其中N是并发用户数(我已对其进行设置,以便每个用户运行一次然后停止)。 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. 我希望这是可能的唯一原因是,我们收到了某人运行的旧测试的报告,其中显示40个用户的40个测试总数,另一个结果显示30个用户的30个测试总数。 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 测试迭代:1
  • Think times: Normal distribution 思考时间:正态分布
  • Load Pattern: Constant Load: 40 Users (I change this for different loads) 负载模式:恒定负载:40个用户(我将其更改为不同的负载)
  • 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. 测试混合模型:我想就是这样,但是我已经尝试了所有这4种,它们都只显示了1次测试运行。
  • 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. 我考虑过尝试为40个用户添加40次相同的测试,但是只允许您添加一次。
  • Network Mix: LAN 网络组合:局域网
  • Browser Mix: IE11 浏览器组合: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". 如果“使用测试迭代次数”设置为true,则在“运行设置”中的“测试迭代次数”字段给出了要执行的测试总数,否则测试将在“运行持续时间”指定的时间内运行。 Setting "Test iterations" to 1 (ie one) means that the test will be executed once. 将“测试迭代次数”设置为1(即一次)意味着测试将执行一次。

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. 如果您需要30个虚拟用户并希望每个用户执行4个测试,则需要设置30 * 4 = 120次迭代。

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 . 为确保每个模拟用户仅执行一个测试,请将“方案”中的“新用户百分比”属性设置为100。请参见本页的 “新用户百分比的影响”部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio负载测试可与一个用户模拟多个用户 - Visual studio load test simulate multiple users with one user Visual Studio 2010负载测试用户评论? - Visual Studio 2010 Load Test User Review? 如何使我的Visual Studio Test Suite Web测试遍历数据源? - How do I get my Visual Studio Test Suite web test to iterate over my data source? 在Visual Studio 2010中执行负载测试时,如何发送存储在cookie中的值? - how do I send the values stored in a cookie while executing a load test in Visual Studio 2010? 如何从Visual Studio负载测试中获得更准确的数据点? - How can I get more exact data-points from a visual studio load test? 如何在Visual Studio中加载测试Web服务? - How to load test web services in Visual Studio? 如何使用Visual Studio 2010负载测试工具测试Web服务器性能 - How to test webserver performance with Visual Studio 2010 Load Test Tools 如何将值列表作为参数传递给Visual Studio Web性能测试或加载测试插件? - How can I pass a list of values as a parameter to a Visual Studio web performance test or load test plugin? 如何在Visual Studio负载测试中初始化每个Web测试 - How can I initialize each web test in a Visual Studio load test 在Visual Studio 2013中进行负载测试,是否必须在远程服务器上安装代理? - Load test in Visual Studio 2013, do I have to install agent on remote server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM