WebTestRequest request1 = new WebTestRequest((this.Context["Environment"].ToString() + "/IBWeb/DefaultSB.aspx"));
request1.Headers.Add(new WebTestRequestHeader("Referer", (this.Context["Environment"].ToString() + "/IBWeb/")));
ExtractHiddenFields extractionRule1 = new ExtractHiddenFields();
extractionRule1.Required = true;
extractionRule1.HtmlDecode = true;
extractionRule1.ContextParameterName = "1";
request1.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule1.Extract);
yield return request1;
request1 = null;
I have a coded web performance test as mentioned above.. The test runs without any issues..But I would like to access the output/response from the WebTestRequest
object. what is the best approach to do it ?
Load testing is used to determine how an application performs based on a certain volume of users. Generally, load tests will increase the volume of requests in the duration of the tests, but load tests can be used to gather performance data from any given load, small or large.
add PostRequest event handler
request1.PostRequest += new EventHandler<PostRequestEventArgs>(request1_PostRequest);
handler method:
void request1_PostRequest(object sender, PostRequestEventArgs e)
{
String responseBody = e.Response.BodyString;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With