0

I have written a webtest that calls a webservice:

 public class Settings_CacheExplosion : WebTest
{
    //private static readonly ILog activityLog = LogManager.GetLogger("Activity"); 

    private static int _ctidsCounter { get; set; }

    public static int CtidsCounter
    {
        get
        {
            if (_ctidsCounter == 2000)
            {
                _ctidsCounter = 1000;
            }
            return _ctidsCounter++;
        }
        set
        {
            _ctidsCounter = value;
        }
    }

    public Settings_CacheExplosion()
    {
        this.PreAuthenticate = true;

        CtidsCounter = 1000;

        //log4net.Config.XmlConfigurator.Configure();
    }


    public override IEnumerator<WebTestRequest> GetRequestEnumerator()
    {
        WebTestRequest request1 = new WebTestRequest("http://clientservice.mam.qasite-services.com/settings");

        request1.Method = "POST";

        Debug.WriteLine(string.Format("ctid={0}", CtidsCounter));

        request1.QueryStringParameters.Add("ctid", CtidsCounter.ToString(), false, false);
        StringHttpBody request1Body = new StringHttpBody();
        request1Body.ContentType = "";
        request1Body.InsertByteOrderMark = false;
        request1Body.BodyString = "";
        request1.Body = request1Body;

        yield return request1;
        request1 = null;
    }
}

I hvae created a load test with test mix: 100% the above webtest

in the load test wizard I have allocated 1000 users (constant).

I set the test to run based on the number of virtual users.

And yet, the load test finishes after 2 seconds.

I the summary I see the above test was executed only 100 times.

What could have caused it?

btw, I tried to watch the requests table but it includes only one row.

How can I see all the made requests?

4

0 回答 0