如何使用testng.xml
您好,我是 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
请帮助我......我们收到错误“无法在类路径中找到类”
Hi i am new to selenium, now i want to run my test suite using selenium rc and eclipse Ide
i have using ant when i execute, for that time i got error in testNG.xml. so kindly tell me any one how to use testng.xml and give me one sample of testng.xml
This is my 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" />
===========================
This is my testng.xml
===================
We are getting following errors:
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
Please help me.....we are getting error for "Cannot find class in classpath"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您启动 TestNG 的类路径包含您的类。
Make sure the classpath you launch TestNG with contains your classes.