I have created a build file, and configured it according to my project (Selenium and Junit). Now the issue is when i run build file, it only runs the first class and saves the same in HTML report. Can any one tell me what m doing wrong and what should be edited / or replaced??
<?xml version="1.0" encoding="UTF-8"?>
<project name="ant" default="exec" basedir=".">
<property name="src" value="./src" />
<property name="lib" value="./lib" />
<property name="bin" value="./bin" />
<property name="report" value="./report" />
<path id="ant.classpath">
<pathelement location="${bin}" />
<fileset dir="${lib}">
<include name="**/*.jar" />
<include name="C:/Users/bhmehta/workspace/ant/lib/libs/*.jar" />
</fileset>
</path>
<target name="init">
<delete dir="${bin}" />
<mkdir dir="${bin}" />
</target>
<target name="compile" depends="init" description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac debug="true"
srcdir="${src}"
destdir="${bin}"
includeantruntime="false"
classpathref="ant.classpath"/>
<!-- Copy files from ${src} into ${build} -->
<copy todir="${bin}">
<fileset dir="${src}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="exec" depends="compile">
<delete dir="${report}" />
<mkdir dir="${report}" />
<mkdir dir="${report}/xml" />
<junit
printsummary="yes"
haltonfailure="no"
>
<classpath><pathelement location="${ant.classpath}" /> </classpath>
<test name="testing.demo" haltonfailure="no" todir="${report}/xml" outfile="TEST-result">
<formatter type="xml" />
</test>
<test name="testing.demo1" haltonfailure="no" todir="${report}/xml" outfile="TEST-result">
<formatter type="xml" />
</test>
</junit>
<junitreport todir="${report}">
<fileset dir="${report}/xml">
<include name="TEST*.xml" />
</fileset>
<report format="frames" todir="${report}/html" />
</junitreport>
</target>
</project>
I have also tried some of the solutions given to similar questions, using <batchtest </batchtest>
tags. But it shows error like
The <junit> type doesn't support ne sted text data (">").
I really don't know what is this all about. Please some one help