Ant+testng+selenium基本配置

Ant 配置
1、在工程根目录下添加 build_TestNG-xslt.xml
2、新建lib目录,添加xml文件里的jar包
3、新建res目录,添加testng-results.xsl 文件(build插件美化报包需要)
这里写图片描述
testng.xml文件也放置在根目录





<path id="jarfile">
    <fileset dir="lib" includes="testng-6.9.10.jar" />
    <fileset dir="lib" includes="reportng-1.1.4.jar" />
    <fileset dir="lib" includes="velocity-dep-1.4.jar" />
    <fileset dir="lib" includes="guice-3.0.jar" />
    <fileset dir="lib" includes="selenium-server-standalone-3.5.3.jar" />
</path>

报告目录,工程/report/html /report/index_new.html
二、脱离eclipse执行工程(cmd命令行执行)
ant.bat -f D:\eclipseworkplace\testfan\build_TestNG-xslt.xml

下载解压ant,配置path环境变量,E:\web\apache-ant-1.9.6\bin

猜你喜欢

转载自blog.csdn.net/qq_27468305/article/details/78379938