Using the Web Application Transaction Monitor is absolutely one of my favorites in SCOM. Adding GSM to this is nothing but brilliant. I know a lot of companies that wants to monitor their websites from outside the organization, and GSM does the job. But… It is not possible to create a Web App. Transaction monitor with GSM out of the box in SCOM. To do this one needs Visual Studio Ultimate. This is not one of the cheap ones.

As a workaround one can you Fiddler2 and Notepad, which does the job. When using Fiddler2 you get a big load of recording entering pages. Here’s an example of recording two seconds of Microsoft.com:

clip_image002

I haven’t found a way to filter properly, so the key is to know what you need from this. If I just need to find some text or measure response time I always use the blue entry (second from the top). I just delete the rest.

Go to File – Export Sessions – All Sessions…

clip_image003

Select Visual Studio Web Test, press Next and save it. Keep all plugins.

clip_image004

This gives you this webtest file:

<?xml version=”1.0″ encoding=”utf-8″?>

<TestCase Name=”FiddlerGeneratedWebTest” Id=”” Owner=”” Description=”” Priority=”0″ Enabled=”True” CssProjectStructure=”” CssIteration=”” DeploymentItemsEditable=”” CredentialUserName=”” CredentialPassword=”” PreAuthenticate=”True” Proxy=”” RequestCallbackClass=”” TestCaseCallbackClass=””>

<Items>

<Request Method=”GET” Version=”1.1″ Url=”http://www.microsoft.com/da-dk/default.aspx” ThinkTime=”0″ Timeout=”60″ ParseDependentRequests=”True” FollowRedirects=”True” RecordResult=”True” Cache=”False” ResponseTimeGoal=”0″ Encoding=”utf-8″>

<Headers>

<Header Name=”DNT” Value=”1″ />

</Headers>

</Request>

</Items>

</TestCase>

Now, without Visual Studio Ultimate you need to add Validation Rules yourself. Validation Rules are, as the name implies, what validates whether the application is healthy or not. For instance, I have added a Validation Rule to find “Microsoft”:

<?xml version=”1.0″ encoding=”utf-8″?>

<TestCase Name=”FiddlerGeneratedWebTest” Id=”” Owner=”” Description=”” Priority=”0″ Enabled=”True” CssProjectStructure=”” CssIteration=”” DeploymentItemsEditable=”” CredentialUserName=”” CredentialPassword=”” PreAuthenticate=”True” Proxy=”” RequestCallbackClass=”” TestCaseCallbackClass=””>

<Items>

<Request Method=”GET” Version=”1.1″ Url=”http://www.microsoft.com/da-dk/default.aspx” ThinkTime=”0″ Timeout=”60″ ParseDependentRequests=”True” FollowRedirects=”True” RecordResult=”True” Cache=”False” ResponseTimeGoal=”0″ Encoding=”utf-8″>

<Headers>

<Header Name=”DNT” Value=”1″ />

</Headers>

</Request>

</Items>

<ValidationRules>

<ValidationRule Classname=”Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidateResponseUrl, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” DisplayName=”Response URL” Description=”Validates that the response URL after redirects are followed is the same as the recorded response URL. QueryString parameters are ignored.” Level=”Low” ExectuionOrder=”BeforeDependents” />

<ValidationRule Classname=”Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidationRuleResponseTimeGoal, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” DisplayName=”Response Time Goal” Description=”Validates that the response time for the request is less than or equal to the response time goal as specified on the request. Response time goals of zero will be ignored.” Level=”Low” ExectuionOrder=”AfterDependents”>

<RuleParameters>

<RuleParameter Name=”Tolerance” Value=”0″ />

</RuleParameters>

</ValidationRule>

<ValidationRule Classname=”Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidationRuleFindText, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” DisplayName=”Find Text” Description=”Verifies the existence of the specified text in the response.” Level=”High” ExectuionOrder=”BeforeDependents”>

<RuleParameters>

<RuleParameter Name=”FindText” Value=”microsoft” />

<RuleParameter Name=”IgnoreCase” Value=”False” />

<RuleParameter Name=”UseRegularExpression” Value=”False” />

<RuleParameter Name=”PassIfTextFound” Value=”True” />

</RuleParameters>

</ValidationRule>

</ValidationRules>

</TestCase>

But if you don’t have Visual Studio Ultimate, how do you know about the different Validation Rules? I haven’t found any website documenting these. I have attached webtest.rar in this post. This file contains two files:

  • One webtest with all Validation Rules. Look for:

             <ValidationRule Classname=”Microsoft.VisualStudio.TestTools.WebTesting.Rules. These are your Validating Rules. If you simply need to find a text, you can use the above example just by replacing the website and       FindText value

  • The webtest i have used in this post, monitoring Microsoft.com

Simply insert the ValidationRules tag between </Items> and </TestCase>.

[download id=”188″]