嗨,我刚接触selenium,现在我想使用selenium rc和eclipse Ide来运行我的测试套件,我在执行时使用了ant,因为那时我在testNG.xml中遇到了错误。所以请告诉我如何使用testng.xml,并给我一个testng.xml示例
这是我的Build.xml
<property name="lib.dir" value="/softwares/lib"/>
<property name="src.dir" value="/softwares/src" /><target name="run_testNG" description="Run TestNG">
<testng classpathref="compile.classpath" haltOnfailure="false">
<xmlfileset dir="/softwares/cruisecontrol-bin-2.8.3/run_test/" includes="testng.xml" />
</testng>
</target>
<target name="start-server">
<java jar="/softwares/selenium/selenium-server-standalone-2.0b2.jar" fork="true" spawn="true">
<arg line="-timeout 30"/>
<jvmarg value="-Dhttp.proxyHost=proxy.corporate.com"/>
<jvmarg value="-Dhttp.proxyPort=3128"/>
</java>
</target>
<target name="stop-server">
<get taskname="selenium-shutdown"
src="http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer"
dest="result.txt" ignoreerrors="true" />
<echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
</target>
<taskdef resource="testngtasks" classpath="/softwares/selenium/selenium-2.0b2/libs/testng-5.14.1.jar" />
===========================
这是我的testng.xml
===================
我们收到以下错误:
Buildfile: build.xml
prepare:
compile:
run_test:
[waitfor] Wait for proxy server launch
start-server:
run_testNG:
[testng] [TestNG] [ERROR]
[testng] Cannot find class in classpath: com.example.tests
[testng] The tests failed.
stop-server:
[selenium-shutdown] Getting: http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer
[selenium-shutdown] To: /softwares/cruisecontrol-bin-2.8.3/run_test/result.txt
[selenium-shutdown] DGF Errors during shutdown are expected
BUILD SUCCESSFUL请帮助me.....we遇到“在类路径中找不到类”的错误
发布于 2011-04-28 10:05:20
确保启动TestNG的类路径包含您的类。
https://stackoverflow.com/questions/5804703
复制相似问题