准备testng的配置文件如下,放在工程的根目录下
接下来是见证奇迹的时候:
在Jenkins里选择构建
Building in workspace C:Program Files (x86)JenkinsworkspaceDemo
[workspace] $ cmd.exe /C '""C:Program Filesapache-ant-1.9.4inant.bat" -file Demo run && exit %%ERRORLEVEL%%"'
Buildfile: C:UsersYoungworkspaceDemouild.xml
[echo] import libs clean:
[delete] Deleting directory C:UsersYoungworkspaceDemouild compile:
[echo] mkdir
[mkdir] Created dir: C:UsersYoungworkspaceDemouildclasses
[javac] C:UsersYoungworkspaceDemouild.xml:21: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 6 source files to C:UsersYoungworkspaceDemouildclasses run:
[testng] [TestNG] Running:
[testng] C:UsersYoungworkspaceDemo estng.xml
[testng]
[testng] Fast test
[testng] Slow test
[testng] Starting ChromeDriver (v2.9.248315) on port 43260
[testng] Starting ChromeDriver (v2.9.248315) on port 20660
[testng] Starting ChromeDriver (v2.9.248315) on port 13803
[testng] cookie write to file
。。。。