locked
Is there any way to send multiple requests with in a single webtest. RRS feed

  • Question

  • I have to test a scenario which consists of 3-4 scenarios. each scenario is dependent on the upper scenario. Web test only sends a single request. Is there any way using which we can set multiple scenario/requests to execute seqentially in a single web test.

    nishu

    Wednesday, August 22, 2012 6:05 AM

Answers

  • Hi nishu,

        To access a response in a coded web performance test you can create a custom plugin. Below is a quick example on how to use an extraction rule to save an entire response into a context parameter. 

    using System;
    using System.Collections.Generic;
    using System.Web;
    using Microsoft.VisualStudio.TestTools.WebTesting;
    using System.ComponmentModel
    
    namespace Library
    {
       [DisplayName("Extract Response")]
       [Description("Extract response and store it into a context parameter")]
       public class ExtractFullResponse : ExtractionRule
       {
          e.WebTest.Context.add("Response", e.Response.BodyString);
       }
    }

    Friday, August 24, 2012 3:49 PM

All replies

  • Hi nishu,

    Thank you for posting in the MSDN forum.

    I have to test a scenario which consists of 3-4 scenarios. Each scenario is dependent on the upper scenario.

    Maybe you could share us more information about this issue, what real result did you want to get? Do you mean that you create a load test with 3-4 scenarios? If so, we often use scenarios like this MSDN document “About Scenarios”.

    If we want to run a web test with many requests, you could add all requests to a web test when you record it.

    Is there any way using which we can set multiple scenario/requests to execute seqentially in a single web test.

    Do you mean that you want to send the requests sequentially? As my understanding, generally all requests will be sent sequentially in default if you record them in the same web test? Like SudhakarG’s reply in this thread “How to execute requests parallely while running vs2010 webperformance test?”, but if you want to control the scenarios sequentially in a load test, I’m afraid that it is not supported. As my understanding, they are in parallel.

    If I have misunderstood anything, please make free feel to let me know.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, August 23, 2012 7:30 AM
    Moderator
  • Hi Jack,

    I want to execute multiple web tests in a single web test and need to pass the response from one web test to another web test.

    Also, how can i retrieve the response in a coded web performance test. I want to store the response. I can see the response retrieved after the web request has been posted on the result viewer only.


    nishu

    • Proposed as answer by Matt Moss Friday, August 24, 2012 3:37 PM
    • Unproposed as answer by Matt Moss Friday, August 24, 2012 3:37 PM
    Friday, August 24, 2012 9:40 AM
  • Hi nishu,

        To access a response in a coded web performance test you can create a custom plugin. Below is a quick example on how to use an extraction rule to save an entire response into a context parameter. 

    using System;
    using System.Collections.Generic;
    using System.Web;
    using Microsoft.VisualStudio.TestTools.WebTesting;
    using System.ComponmentModel
    
    namespace Library
    {
       [DisplayName("Extract Response")]
       [Description("Extract response and store it into a context parameter")]
       public class ExtractFullResponse : ExtractionRule
       {
          e.WebTest.Context.add("Response", e.Response.BodyString);
       }
    }

    Friday, August 24, 2012 3:49 PM