DCSIMG
How To Create A Custom Extraction Rule In Team System Web Test - SRL Group

SRL Group

This blog is about Team System, QA and Development methodologies and more...

VSTS Resources

Team System Bloggers

How To Create A Custom Extraction Rule In Team System Web Test

There are times when you need to write your own extraction rule, it is very simple to do that just follow these steps:

Step 1: Create a new project, make it a “Class Library” type.

Step 2: Add a reference to: Microsoft.VisualStudio.QualityTools.WebTestFramework.dll located in “Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\”.

Step 3: Add the following using:
using Microsoft.VisualStudio.TestTools.WebTesting;
using Microsoft.VisualStudio.TestTools.WebTesting.Rules;
using System.ComponentModel;

Note: The last using is not related to the Team System but it will let us the use of attributes in order to make the implementation simple.

Step 4: Next step is to add the following:

namespace CustomExtraction
{
    [DisplayName("Rule Name")]
    [Description("Rule Description")]
    public class FirstExtractionRule : ExtractionRule
    {
        public override void Extract(object sender, ExtractionEventArgs e)
        {
            Put here your code…
        }
    }
}

Important: Don’t forget to make the class public!!!

Step 5: Now add a reference from your test project to the extraction rule project in order to see your new extraction.

Now you can start using your new extraction rule, you will see it with the name you defined in the “Display Name” attribute

Have Fun!!!

Comments

Shai Raiten said:

Team System – How to Create Custom Extraction Rule [HE] - Screencast

# April 20, 2009 7:55 AM

Team System News said:

Larry Guger on Workspaces in Team Foundation Server - Part 3 Jeff Beehler on Resources to learn more

# April 22, 2009 5:50 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: