mercredi 22 avril 2015

Generic test with summary result file, "Summary Result File Schema Could Not Be Loaded"

I'm doing some experiments with use of generic test and use of summary result files. The purpose with summary result files is to be able to split one generic test into several smaller inner tests.

I have a small test setup like this:

My generic test looks like this (TestPass.GenericTest):

<?xml version="1.0" encoding="UTF-8"?>
<GenericTest name="TestPass" storage="c:\tfs\mstest\testpass.generictest" id="481fe683-c835-4cf5-aa15-532b4e4e50df" xmlns="http://ift.tt/1o0hquU">
  <Execution id="087a367f-ac5b-4ab7-bb69-e506b436f51b" />
  <Command filename="runtest.bat" arguments="%TestOutputDirectory%" workingDirectory="%TestLocation%" />
  <SummaryXmlFile enabled="true" path="LocalTest.trx" />
</GenericTest>

When running this test it simply calls a bat-file which generate the summary result files and the inner result files:

runtest.bat:`

copy sr.xml "%TestOutputDirectory%"\LocalTest.trx
copy r1.txt "%TestOutputDirectory%"\Results1.txt
copy r2.txt "%TestOutputDirectory%"\Results2.txt

sr.xml:

<SummaryResult>
    <TestName>ParentTest</TestName>
    <TestResult>Passed</TestResult>
    <InnerTests>
        <InnerTest>
            <TestName>InnerTest1</TestName>
            <TestResult>Passed</TestResult>
            <ErrorMessage>Everything is fine.</ErrorMessage>
            <DetailedResultsFile>Results1.txt</DetailedResultsFile>
        </InnerTest>
        <InnerTest>
            <TestName>InnerTest2</TestName>
            <TestResult>Failed</TestResult>
            <ErrorMessage>Something went wrong.</ErrorMessage>
            <DetailedResultsFile>Results2.txt</DetailedResultsFile>
        </InnerTest>
    </InnerTests>
</SummaryResult>

r1.txt:

This is the the resultfile for innertest1

r2.txt:

This is the the resultfile for innertest2

I run the test like this:

mstest /testcontainer:TestPass.GenericTest

And now to the problem. The test fails with "Summary Result File Schema Could Not Be Loaded"

Aucun commentaire:

Enregistrer un commentaire