Sunday, July 27, 2014

VSTS performance testing : How to extract values from Binary format responce in VSTS

Problem : We are getting a dynamic value in Request1 response. b) But the value is coming in Binary format + text format. How to extract the dynamic value or how to add validation text.



Solution: 1. You can take the response from the recorded result. There you will have in normal format. You can use that text to extract value. How I have to extract if I loss recorded result: You can read that particular response into note pad by applying web request plug in with below code. public class Class1:WebTestRequestPlugin { public override void PostRequest(object sender, PostRequestEventArgs e) { base.PostRequest(sender, e); String text = e.Response.BodyString.ToString(); System.IO.File.WriteAllText(@"D:\WriteText.txt", text); } }

VSTS performance testing : Exception in pre web event : Could not load file or assembly ....

While running web test we are getting below error.
Exception in pre web event : Could not load file or assembly .... (PFA screenshot)

Solution: take project .dll file from BIN folder and add it into local test settings.

VSTS performance testing :How to extract dynamic values from 302 redirect requests in VSTS

Issue : We are getting dynamic value in 1st request’s (Request 1) response and it is redirected (302) to another request (say request2). The same value (which came as dynamic value in Request 1) used in Request 2. How to extract this dynamic value?

Solution:
1. Select 1st request Properties  Follow redirects = false. 2. Now you will be able to add extraction rule for dynamic value. 3. Copy the 2nd request (200 OK) and add in the web test and replace the dynamic value with extracted value. 4. If there are any extraction rules in the 1st request move to 2nd request.