Load Test SSRS Report

Sudhakarj21
Posted by in Sql Server category on for Beginner level | Views : 8374 red flag

SQL Server Reports are one of the key components in many of the applications and when we do Load test on an application we also make sure that the SQL Server is also capable of delivering the report in time on Load Conditions during concurrent scenarios. This Article will help to create a Web Test using Visual Studio Test Edition and and run the load test with.
Introduction

VSTS Test Edition provide different tests. One of the test framework is Web Test which will help us to record the tests and run that. But to do web test on a report the possiblity is less becuase of the limitations of report vieiwer becuase of AJAX report rending in MHTML. Say for example if the load test scenario is to execute the report in some other format it is not possible to create web test.


Web Test
To create Web Test we will use URL/Query based Report Rendering which will avoid the above limitations. You can used different commands in Query string you can get these details from Microsoft Site and here is the web test code

public class SimpleReportTest : WebTest
{

    public SimpleReportTest()
    {
        this.PreAuthenticate = true;

        //Enter your credenatials
        this.UserName = "userid";
        this.Password = "pwd";
    }

    public override IEnumerator<WebTestRequest> GetRequestEnumerator()
    {
        WebTestRequest request = new WebTestRequest("http://SSRSServer/ReportServer/Pages/ReportViewer.aspx");
        WebTestRequestHeaderCollection headers = request.Headers;

        // First remove all existing headers.
        headers.Clear();

        headers.Add("Cookie", "(automatic)");

        // Before each request, clear all existing parameters.
        request.QueryStringParameters.Clear();
        request.QueryStringParameters.Add("rc:Toolbar", "False");
        request.QueryStringParameters.Add("rs:Command", "Render");

        // Choose to set Think Time to 20 seconds.
        request.ThinkTime = 20;

        //Report Name and Parameters
        request.QueryStringParameters.Add("", "{ReportPath}", true, false);
        request.QueryStringParameters.Add("{PARAM1}", "110106");

        yield return request;
    }
}

In above web test you just need to modify the highlighted details and create a Load Test by adding this web test as scenario in Visual Studio Test Edition. Many scenarios like export and other commands can be added to the request to do Load Test on SSRS Report.

Conclusion

For more information on how to create Load Test from Web Test Go To Visual Studi Test Edition Site or i will publish few more posts on this.

Page copy protected against web site content infringement by Copyscape

About the Author

Sudhakarj21
Full Name: Sudhakar Kottapalli
Member Level: Bronze
Member Status: Member
Member Since: 10/5/2009 7:05:50 AM
Country:



Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)