2017-01-17 56 views
1
  1. 我的項目dosnt有一個bin文件夾
  2. 曾嘗試以下:

d:> java命令「Pathtolibfolder \ lib中*; Pathtobinfolder \ bin「 org.testng.TestNG testng.xml從詹金斯(Maven項目)執行的testng.xml

任何想法?

+0

什麼錯誤您收到? –

+0

@Maciej Kowalski感謝您的快速響應,它說它無法找到bin目錄,我的項目是一個maven項目,所以dosnt有一個bin文件夾? – Gbru

回答

2

如果您正在使用Maven那我就簡單地使用萬無一失插件,運行測試作爲構建的一部分:

<plugins> 

    ... 

     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <version>RELEASE</version> 
     <configuration> 
      <suiteXmlFiles> 
      <suiteXmlFile>testng.xml</suiteXmlFile> 
      </suiteXmlFiles> 
     </configuration> 
     </plugin> 

    ... 

</plugins> 

只要指定路徑到您的testng.xml如果你能利用它的優勢使用這種配置。它允許大量的參數化,我已經在我的項目中廣泛使用它。

退房本教程得到它掛起:http://maven.apache.org/surefire/maven-surefire-plugin/examples/testng.html

+0

非常感謝您的幫助 – Gbru

+0

@ Phil_P85如果Maciej提供的答案有效,請幫助接受他的回答。 –

+0

@Krishnan Mahadevan全部完成 – Gbru