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.
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