How to get ant JUnit result in user defined xml file name? Junit (ant task) by default creates TEST-testcasename.xml for results, is there a way to change this xml file name? I am running same testcase multiple times for different browsers and currently the result for one browser is being overwritten by another browser's result.
Here is my code:
<target name="junit1">
<junit fork="true" forkmode="once" haltonfailure="false" logfailedtests="true">
<classpath refid="classpath.project"/>
<formatter type="xml"/>
<jvmarg value="-Dbrowser=${browser}"/>
<batchtest todir="${dir.report}">
<fileset dir="${dir.src}">
<include name="${testcase}"/>
</fileset>
</batchtest>
</junit>
Why don't you just use a different output directory for each browser, or copy the output directory to another one when tests are finished?
<batchtest todir="${dir.report}/${browser}">
If you need all the files to be in the same directory, rename (or copy) them after each batch using the move (or copy) task with a glob mapper :
<mapper type="glob" from="TEST*.xml" to="${browser}-TEST*.xml"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With