2017-07-17 62 views
0

我想使用jenkins運行我的testNg.xml文件。但發生以下錯誤。 enter image description hereJenkins testng錯誤

詹金斯設置

  • 我不使用任何的源代碼管理方法,所以我一直是不
  • 構建觸發器設置,使「建設每當快照依賴是建立」
  • 生成
    • 根POM = C:\ù SERS ******* \ AutomationProject \ entution_6_26 \ pom.xml的全球工具配置下
    • 目標和選項=乾淨的測試

  • JDK安裝有設置爲自動安裝

  • Maven Configuration set as,

    • 默認設置提供=設置在文件系統中的文件

    • 文件路徑= C:\用戶*** M2 \ settings.xml的

  • 默認的全局設置提供商=使用默認的Maven全局設置

TestNG的文件

<?xml version="1.0" encoding="UTF-8"?> 
 
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > 
 

 
<suite name="Entution v1.1"> 
 

 
    <test name="Purchase Order Form"> 
 
     <classes> 
 
      <class name="Procurement._01_PurchaseOrder.TestCases.TestCase_13_Procurement_PurchaseOrder" /> 
 
     </classes> 
 
    </test> 
 

 
    <test name="Inbound Shipment Form"> 
 
     <classes> 
 
      <class name="Procurement._01_PurchaseOrder.TestCases.TestCase_13_Procurement_InboundShipment" /> 
 
     </classes> 
 
    </test> 
 

 
    <test name="Purchase Invoice"> 
 
     <classes> 
 
      <class name="Procurement._01_PurchaseOrder.TestCases.TestCase_13_Procurement_PurchaseInvoice" /> 
 
     </classes> 
 
    </test> 
 

 
</suite> \t

POM文件

<?xml version="1.0" encoding="UTF-8"?> 
 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
 
    <modelVersion>4.0.0</modelVersion> 
 

 
    <groupId>test11</groupId> 
 
    <artifactId>test11</artifactId> 
 
    <version>1.0-SNAPSHOT</version> 
 

 
    <dependencies> 
 

 
    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> 
 
    <dependency> 
 
     <groupId>org.seleniumhq.selenium</groupId> 
 
     <artifactId>selenium-java</artifactId> 
 
     <version>3.4.0</version> 
 
    </dependency> 
 

 
    <!-- https://mvnrepository.com/artifact/org.testng/testng --> 
 
    <dependency> 
 
     <groupId>org.testng</groupId> 
 
     <artifactId>testng</artifactId> 
 
     <version>6.11</version> 
 
     <scope>test</scope> 
 
    </dependency> 
 

 
    <dependency> 
 
     <groupId>commons-configuration</groupId> 
 
     <artifactId>commons-configuration</artifactId> 
 
     <version>1.6</version> 
 
    </dependency> 
 

 
    <dependency> 
 
     <groupId>org.jenkins-ci.main</groupId> 
 
     <artifactId>jenkins-core</artifactId> 
 
     <version>2.68</version> 
 
     <scope>provided</scope> 
 
    </dependency> 
 

 
    <dependency> 
 
     <groupId>org.apache.maven.plugins</groupId> 
 
     <artifactId>maven-compiler-plugin</artifactId> 
 
     <version>3.6.1</version> 
 
    </dependency> 
 

 
    </dependencies> 
 

 
    <build> 
 
    <plugins> 
 
     <plugin> 
 
     <groupId>org.apache.maven.plugins</groupId> 
 
     <artifactId>maven-surefire-plugin</artifactId> 
 
     <version>2.20</version> 
 
     <configuration> 
 
      <suiteXmlFiles> 
 
      <suiteXmlFile>TestNgSuite.xml</suiteXmlFile> 
 
      </suiteXmlFiles> 
 
     </configuration> 
 
     </plugin> 
 
    </plugins> 
 
    </build> 
 

 
    <!-- https://mvnrepository.com/artifact/org.jenkins-ci.main/jenkins-core --> 
 

 
</project>

文件層次 enter image description here

+0

您確實需要jenkins-ci依賴關係嗎?正試圖實現一個Jenkins插件? – khmarbaise

+0

你能解釋更多嗎? –

+0

我不想實現任何插件。我只想運行我的testNg.xml文件使用POM.xml。 –

回答

0

我刪除了屬於Jenkins的POM.xml文件中的所有依賴關係。問題解決了...