首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Build.xml问题

Build.xml问题
EN

Stack Overflow用户
提问于 2012-03-20 18:06:50
回答 1查看 507关注 0票数 0

硒-蚂蚁-TestNG

我已经写了一个build.xml,它产生了一个错误,声明“任务定义元素的类名属性未定义”。

这是我的build.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?> 
 <project name ="AutomationScripts" default="test" basedir=".">
 <echo message ="Testing selenium server... Plz wait"/>
 <target name="startServer">
 <echo message ="Start selenium server... Plz wait"/>  
 <java jar="..\lib\selenium-server-standalone-2.19.0.jar" fork="true">
 <jvmarg value="-Dhttp.proxyHost=192.168.0.200"/>
 <jvmarg value="-Dhttp.proxyPort=3128"/> </java>
 <echo message ="Started selenium server"/>
 </target>
 <target name="test" depends="startServer">
 <echo message="Test run. Please wait"/>
 <mkdir dir="out" />
 <java classname="RosettastoneMain" classpath="..\AutomationScripts\bin" 
 dir="C:\Program Files\Java\jdk1.6.0_11\bin">
 <classpath>
<fileset dir="..\AutomationScripts\lib" includes="*.*"/>
 </classpatha></java>
 <taskdef name="testng" classpath="org.testng.TestNG">     ---------> It produces 
 error in this stmt 
 <classpath>
 <pathelement location="../lib/testng-6.2.jar"/>
 </classpath>
 </taskdef>
 <property name="testng.output.dir" value="testngOutput"/>
 <path id="classes">
 <fileset dir="../lib">
  <include name="*.jar"/>
 </fileset>
 <pathelement location="${bin.dir}"/>
 </path>
 <mkdir dir="${testng.output.dir}"/>
 <testng outputdir="${testng.output.dir}" classpathref="classes">  
 <xmlfileset dir="." includes="testng.xml"/>  
 </testng> </target>
<target name="stopServer">
 <echo message="stop selenium server. Plz wait"/>
 <get taskname="selenium-shutdown" 
 src="http://localhost:4444/selenium-server-standalone-2.0rc2/driver/?cmd=shutDown"
 dest="./out/sever.stop.status.txt" ignoreerrors="true"/>
</target>
</project>

有人能帮我吗?提前谢谢

EN

回答 1

Stack Overflow用户

发布于 2012-07-06 05:28:43

您需要在“classname”属性中指定实现数据类型的类。根据Ant文档(更具体地说是typedef),这个任务有两个必需的属性--‘taskdef’和'classname',除非指定了'file‘或’typedef‘。属性'classpath‘仅定义可以找到在'classname’中指定的类的位置。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9784699

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档