1

I'm currently trying to create a performance test in Visual Studio 2013 for an older web application with numerous redirects. One of these redirects contains a url with a + in it.

<h2>Object moved to <a href="%2fPage.aspx%3fname%3dLYNDON+VROOMAN%26type%3dMyType">here</a>.</h2>

When Visual Studio attempts to run the web performance test and follows the redirect, it attempts to go to /Page.aspx?name=LYNDON VROOMAN&TYPE=MyType which of course returns a 400. The redirect, of course, is also not appearing in the recording.

I don't normally run performance tests on web sites with a GUI. I've tried added an HTMLEncoded flag to every parameter, and tried generating code and adding a replace to any of the strings that I can see.

I'm sure that it's something small that I'm missing, but, I'm not seeing it and my searches for information are coming back fruitless.

  • I think you are trying to go inside login during load testing. Do you? – Helping Hands Jan 27 '15 at 9:19
  • nope, there's no login here. The name is pulled in the backend via a call to another service. – Lyndon Vrooman Jan 27 '15 at 16:24
  • If there is no authentication then it should not show that "Object moved" to error. – Helping Hands Jan 28 '15 at 3:44
  • Hmm. I'll have to see if there's something that I'm not seeing right now. – Lyndon Vrooman Jan 28 '15 at 17:00
2

I had got the same issue with web performance test in Visual Studio 2013. Some redirects in my application contains a white space in their url

<h2>Object moved to <a href="/Error/SubErr.aspx?GROUP=MED SH&amp;USER=DAVID GOUPIL">here</a>.</h2>

When visual studio attempts this redirect, the web test returns a Bad request.

I finally use a WebTestPlugin to encode each query string parameters before each requests

public override void PreRequest(object sender, PreRequestEventArgs e)
{
    foreach (var queryStringParam in e.Request.QueryStringParameters)
        queryStringParam.UrlEncode = true;
}

And add this event to the PreRequest event on MyWebTest.

private MyWebTestPlugin myPlugin = new MyWebTestPlugin();     
public MyWebTest()
{
    this.PreAuthenticate = true;
    this.Proxy = "default";
    this.PreRequest += this.myPlugin.PreRequest;
}

Hope it helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.