How to programmatically find all errors after web test failed.

I am working och a test that is composed of the generade C# code from a web test. This code is compiled into a DLL and executed via MSTEST.EXE.

When adding e.g. ValidationRuleFindText this can result in an error.

I would like to find all those errors after the iteration is complete and plan to do that in a PostWebTest event handler.

However I can't find out how to access the results from all Validate events for the rules and there is a little lack of information in the beta documentation so please help me.

[518 byte] By [StenPalmqvist] at [2007-12-16]
# 1

Sten,
MSTest is going to create an output .trx (test result xml) file for each run that will contain a listing of all errors. It might be easiest to load that XML and looking for any errors that way.

There's not a way to access all validation rule failures from within a web test other than if you were to do some of that bookkeeping yourself. It would be possible, for example, to have all your WebTestRequest.ValidateResponse events run through an event handler method(s) that would invoke validation rules and then save whether the e.IsValid was set to true or false.

Josh

JoshChristieMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 2
Thanks Josh !

This really helped me. I already have my own event handler for the ValidateResponse events but I did not think of this solution to pass the object and the event args to the rules validate method and then check for the status of e.IsValid. Simple but efficient and perfect for my purposes.

Sten

StenPalmqvist at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 3
That's great to hear! I'm glad to have been able to help out.

Josh

JoshChristieMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...

Visual Studio Team System

Site Classified