您的位置:軟件測試 > 開源軟件測試 > 開源單元測試工具 > TestNG
jenkins+testng+ant+webdriver持續(xù)集成測試
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2013/12/18 10:24:20 ] 推薦標簽:

執(zhí)行testng.xml

     <target name="run_tests" depends="compile">   

         <testng classpathref="compile.path"  failureproperty="test.failed">        

             <!--xml test suite file -->

             <xmlfileset dir="${basedir}">

                 <include name="testng.xml" />

             </xmlfileset>                       

         </testng>       

         <antcall target="sendReport" />      

         <fail message="ERROR: test failed!!!!!" if="test.failed" />

     </target>    

 <taskdef resource="testngtasks" classpath="${lib.dir}/testng-6.4.jar" /> 

這里遇到的問題:

1、Cause:

The name is undefined. Action:

Check the spelling. Action:

Check that any custom tasks/types have been declared.

Action: Check that any <presetdef>/<macrodef> declarations have taken place.

創(chuàng)建任務(wù)無法成功。

解決辦法:

    1)http://ant-contrib.sourceforge.net/ 下載ant-contrib-1.0b3.zip

    2)下載完后,解壓,將ant-contrib-1.0b3.jar,放在你安裝的ANT下的lib下可;


結(jié)果輸出到指定位置

<target name="transform">

        <xslt in="${basedir}/test-output/testng-results.xml" style="${basedir}/test-output/testng-results.xsl" out="${basedir}/test-output/index1.html" classpathref="compile.path">

            <!-- you need to specify the directory here again -->

            <param name="testNgXslt.outputDir" expression="${basedir}/test-output/" />

            <param name="testNgXslt.showRuntimeTotals" expression="true"/>

            <!--<classpath refid="compile.path" />-->

        </xslt>

    </target>

上一頁12345下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd