Sunday, October 31, 2010

PDC10: Test Automation Everywhere

Overview of automation tests in VS 2010 and how they can be integrated with build process - Test Automation Everywhere.

Download Materials - FT53 Test Automation Everywhere.

Friday, October 22, 2010

Web Test & Data Source

One of the benefits of web tests in VS that they can be combined into the scenario. For example, Scenario includes two web tests and each of them uses the same data from data source.  I guess, it will be more elegant to have such data source in Scenario and do not add it to the each of test separately. Magic property of data source “Select all columns” will help us to do this.


After that, all columns will be accessible in the Context. Each column will be automatically binded to the corresponding context parameter with name “DataSourceName.TableName.ColumnName”.

For example, we need to check response and find value from the data source. Custom Validation rule will help.
[Description("Validate text from data source column at the response")]
public class ValidateData : ValidationRule
{
    [Description("Binded to the DataSource Context parameter name = DataSourceName.TableName.ColumnName")]
    public string DataSourceName { set; get; }

    public override void Validate(object sender, ValidationEventArgs e)
    {
        if (DataSourceName == null)
            return;
        if (e.Response.BodyString == null)
            return;

        var searchData = e.WebTest.Context[DataSourceName].ToString();
        e.IsValid = e.Response.BodyString.Contains(searchData);
        e.Message = e.IsValid
            ? string.Format("{0} found", searchData)
            : string.Format("Did not find  {0}", searchData);
    }
}

Validation rule can be added by the right click on the request that should be validated. Fill DataSourceName value and run the test.
Validation result will be at the “Details” tab of the web test result file.

Tuesday, October 19, 2010

Getting Started

It is common case when you come across with new tools and try to find out as much information as possible to understand the main approach and features of this tool. Sometimes it is difficult to extract really useful information from the huge amount that is presented. I decided to share some useful links here:

If you a not common with web, performance testing, I guess this video will be useful

If you just started web testing with Visual Studio, pay your attention to the following resources:

Blogs:
Ed Glas's blog on VS load testing - extremely useful blog, my favorite one.
Sean Lumley's Blog
YuTong's Blog
Bill Barnett's blog

Forum: 
Visual Studio Web Performance and Load Testing Forum

Documentation:
Web testing guidance on MSDN
Visual Studio Performance Testing Quick Reference Guide - provide quick reference points around various aspects of Visual Studio performance testing features that may not be covered in core documentation, or may not be easily understood.

Additional tool:
Fiddler - helps to catch web request that cannot be caught by VS.