Я могу запускать свои тесты через Ant в среде IDE.dataDriven excel - ant через commandLine (testng ant webdriver)
Но, в то время я пытаюсь запустить его из командной строки - это не удается, потому что не могу найти Excel из ресурсов я добавил:
`<copy todir="test/Resources/Data">
<fileset dir="${Resources}/Data">
<exclude name="**/*.java"/>
</fileset>
</copy>`
файл скопирован, но все-таки удастся. Похоже, код не выглядит в нужном месте. Есть идеи?
полный build.xml:
<project name="TestNGTest" default="test" basedir=".">
<!-- Define <testng> task -->
<taskdef name="testng" classname="org.testng.TestNGAntTask">
<classpath>
<pathelement location="lib/testng-6.8.5.jar"/>
</classpath>
</taskdef>
<property name="testdir" location="test" />
<property name="srcdir" location="src" />
<property name="libdir" location="lib" />
<property name="full-compile" value="true" />
<property name="Resources" location="Resources"/>
<copy todir="test/Resources/Data">
<fileset dir="${Resources}/Data">
<exclude name="**/*.java"/>
</fileset>
</copy>
<path id="classpath.base"/>
<path id="classpath.test">
<fileset dir="${libdir}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${testdir}" />
<pathelement location="${srcdir}" />
<path refid="classpath.base" />
</path>
<target name="clean" >
<delete verbose="${full-compile}">
<fileset dir="${testdir}" includes="**/*.class" />
</delete>
</target>
<target name="compile" depends="clean">
<javac srcdir="${srcdir}" destdir="${testdir}"
verbose="${full-compile}">
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="test" depends="compile">
<testng outputdir=".test-output" classpathref="classpath.test"
useDefaultListeners="false"
listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
<xmlfileset dir="." includes="testng.xml"/>
</testng>
</target>
</project>'
Можете ли вы описать больше через xml-файл? –
Я добавил build.xml – ygrunin
В моем коде у меня есть: 'public String ExcelFilePath = System.getProperty (" user.dir ") +" /Resources/Data/TestDataCandex.xls ";' может быть, это проблема - после компиляции он не может найти файл? – ygrunin