1

I started using Visual Studio load test a few days ago. I am calling a URL and get the average response time results. My problem is I want the test tool send 1 user 1 request. But the test tool sends 1 request every 5 secs. How can I limit the number of total request. I want to connect my code to an MDB file which has 2000 records. And I want 1 user to send these 2000 records one by one.

My current code is as below. Please help.

Best regards

public override IEnumerator<WebTestRequest> GetRequestEnumerator()
    {
        WebTestRequest request;

        if (true)
        {
            request = new WebTestRequest("http://192.168.1.36:8888/webgis_net/wms.ashx?NCWS=OGM&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=30.4181109599491,40.4702930755111,30.4195710292824,40.4717531448444&SRS=EPSG:4326&WIDTH=256&HEIGHT=256&LAYERS=Uydu,ILCELER,ILLER,MAHALLE_HAT,CASN,ORMAN,ORMAN_HAT,B2,B2_HAT,ZIRAAT,ZIRAAT_HAT,SU,SU_HAT,NOKTA,OSN&FORMAT=image/png");
            request.Method = "GET";
            request.Timeout = 180;
            yield return request;

        }
    }
chaliasos
  • 9,659
  • 7
  • 50
  • 87

1 Answers1

0

When you create your new Load Test do the following in the New Load Test Wizard:

  1. In the Load Pattern tab check the Constant Load option and set the User Count = 1
  2. In the Test Mix Model tab check the Bases on the number of tests option
  3. In the Test Mix tab add only the Web Test you want
  4. In the Run Settings tab check the Test Iterations option and set the Test Iterations = 2000

With this way, only one virtual user will be created and the Tests (2000) will be one after the other but not concurrently

chaliasos
  • 9,659
  • 7
  • 50
  • 87
  • Hi, Thanks for your reply. I use Visual Studio 2005 Team Suite. I already created Load Pattern User Count=1. I don't see a "Test Mix Model" tab. I see Test Mix and Run Settings sections. But I don't see the Test Iterations on Run Settings. Was it different on that version ? Many thanks – Ceyhun Ganioglu Sep 19 '12 at 08:35
  • Ok, in your case there is not the `Test Iteration` option in the `Run Settings` so you can only set the Load Test duration (not the total test runs). If you want exactly 2000 test runs, then you should some how to add this functionality by code. Maybe, use a counter on your web test and abort the Load Test, or add a Load Test plugin if possible. I am not familiar with Load Tests in VS 2005. – chaliasos Sep 19 '12 at 08:50
  • Hi, I put a counter on the test code. And I want to send a "finish test" command to stop the test but I don't know how to send. I tried to use Stop() and break didn't work properly. I think there must a stop test command. I don't know how to do that. – Ceyhun Ganioglu Sep 19 '12 at 13:40