In a particular Visual Studio Web Performance Test I'm sending a set of requests asynchronously. I'd like to find a way to access the response from every request in this set.
To send the requests asynchronously I'm using the DependentRequests
property of the WebTestRequest
.
My code to implement the enumerator in the test's WebTest
class and send out the requests looks like:
public override IEnumerator<WebTestRequest> GetRequestEnumerator()
{
WebTestRequest request = new WebTestRequest("http://url1");
request.DependentRequests.Add(new WebTestRequest("http://url2");
request.DependentRequests.Add(new WebTestRequest("http://url3");
yield return request;
I can get the response body from http://url1
using the LastResponse
property in the WebTest
class .
string bodyStringFromURL1 = LastResponse.BodyString;
}
How can I get the response bodies from http://url2
and http://url3
?