当我尝试构建我的Selenium测试时,使用以下错误获取BUILD失败消息。 [我可能会在我的build.xml中遗漏一些内容],有人可以看看,让我知道这里缺少的东西PLZ。
我检查了我的build.xml,但没有找到线索。
错误:
7: package org.openqa.selenium.firefox does not exist
[javac] import org.openqa.selenium.firefox.FirefoxDriver;
[javac] ^
....
.............
BUILD FAILED
C:\Users\xxx\build.xml:70: Compile failed; see the compiler err
or output for details.
这是我的build.xml
<project name="myproj" default="usage" basedir=".">
<property name="ws.home" value="${basedir}" />
<!--<property name="ws.jars" value="${basedir}/lib" /> -->
<property name="ws.jars" value="C:\Jars" />
<property name="test.dest" value="${ws.home}/build" />
<property name="test.src" value="${ws.home}/src" />
<property name="ng.result" value="test-output" />
<target name="setClassPath" unless="test.classpath">
<path id="classpath_jars">
<fileset dir="${ws.jars}" includes="*.jar" />
</path>
<pathconvert pathsep=":"
property="test.classpath"
refid="classpath_jars"/>
</target>
<target name="init" depends="setClassPath">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa" />
</tstamp>
<condition property="ANT"
value="${env.ANT_HOME}/bin/ant.bat"
else="${env.ANT_HOME}/bin/ant">
<os family="windows" />
</condition>
<taskdef name="testng" classpath="${test.classpath}"
classname="org.testng.TestNGAntTask" />
</target>
<!-- all -->
<target name="all">
</target>
<!-- clean -->
<target name="clean">
<delete dir="${test.dest}"/>
</target>
<!-- compile -->
<target name="compile" depends="init, clean">
<delete includeemptydirs="true" quiet="true">
<fileset dir="${test.dest}" includes="**/*" />
</delete>
</target>
<echo message="Making directory...."/>
<mkdir dir="${test.dest}"/>
<echo message="classpath:... ${test.classpath}"/>
<echo message="${test.classpath}"/>
<echo message="compiling...."/>
<javac
includeantruntime="false"
debug="true"
destdir="${test.dest}"
srcdir="${test.src}"
target="1.6"
classpath="${test.classpath}">
</javac>
<!-- build -->
<target name="build" depends="init">
</target>
<!-- run -->
<target name="run" depends="compile">
<testng classpath="${test.classpath}:${test.dest}" suitename="Default suite">
<xmlfileset dir="${ws.home}" includes="testng.xml" />
</testng>
</target>
<!-- Usage -->
<target name="usage">
<echo>ant run will execute the test</echo>
</target>
<path id="test.c">
<filelist dir="${ws.jars}" includes="*.jar" />
</path>
<target name="makexsltreports">
<mkdir dir="${ws.home}/XSLT_Reports/output"/>
<xslt in="${ng.result}/testng-results.xml"
style="${ws.home}/testng-results.xsl"
out="${ws.home}/XSLT_Reports/output/index.html" >
<param name="testNgXslt.outputDir"
expression="${ws.home}/XSLT_Reports/output"/>
<param name="testNgXslt.showRuntimeTotals" expression="true" />
</xslt>
</target>
</project>