MSDN Magazine Launch Issue - February 15, 2008 - (Page 31) Figure 6 Intermediate Extended Test Results File MyCOMLib Test Run Failed C:\AdditionalResults\Details.txt 001 Passed 002 Failed data will be copied into the output directory so that it can be referenced via a local, relative path. Extended Test Results Now you’ve seen how to use VSTE for Testers to manage simple custom test automation. You can also create test automation that saves additional information and more detailed test results. The basic idea is to code your test automation so that it saves intermediate detailed test results as a simple XML file that conforms to a special SummaryResult.xsd schema. VSTE for Testers automatically uses the emitted simple XML results file to create the more complex .trx results file that is managed by Visual Studio Team System. This twostep process is much easier than trying to write test automation that directly produces a .trx test results file. It is easiest to understand this process by working backward. The listing in Figure 6 shows an XML test results file that conforms to SummaryResult.xsd and so can be automatically converted to a .trx results file. The file in Figure 6 has required overall TestName and TestResult values and an optional overall DetailedResultsFile value. Other optional values defined by the SummaryResult.xsd schema include InnerTest to store the name and results of test cases that make up the overall Generic Test, and ErrorMessage values. The SummaryResult.xsd schema file is installed with VSTE for Testers and is typically located at C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas\. The schema defines test result types other than simply Passed and Failed. Additional defined result types are Aborted, Error, Inconclusive, NotRunnable, NotExecuted, Discontinued, Warning, InProgress, Pending, PassedButRunAborted, and Completed. Exactly how you write your custom test automation to emit an intermediate extended XML test case results file depends on the programming language you are using and the structure of your automation logic. If you want to use the InnerTest tag, the SummaryResult.xsd schema dictates that you must specify the overall test result before you specify the result of each test case. This means you cannot build up your intermediate XML results file in a strictly sequential way while processing your test case data. There are many approaches you can take. The listing in Figure 7 shows one way to modify the test automation script presented in Test Run launch2008 31 http://www.scaleoutsoftware.com http://www.scaleoutsoftware.com
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.