2013-09-23 46 views
0

我有一個使用TestNG進行Selenium WebDriver測試的maven項目。我想在組運行測試,這就是爲什麼重要的是要在POM文件萬無一失的插件,多數民衆贊成我加入POM文件: enter image description hereMaven不會在pom中使用surefire插件構建項目

如果我將使用maven那些話後運行我的項目(用TestNG是仍然工作),我在控制檯中出現錯誤,WebDriver甚至沒有打開。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test 
(default-test) on project PORefactor: Execution default-test of goal 
org.apache.maven.plugins:maven-surefire-plugin:2.15:test failed: There was an error in 
the forked process. 

也:

[ERROR] Cannot find class in classpath: com.volnoboy.POImplementation 

我試圖刷新和清潔項目。我把項目移到了不同​​的電腦上,錯誤也是一樣的。互聯網連接是好的。我該怎麼辦?

回答

0

這是我的聚甲醛

  <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.15</version> 
      <configuration> 
       <!-- <groups>1</groups> --> 
       <suiteXmlFiles> 
        <suiteXmlFile>testSuites\testng1.xml</suiteXmlFile> 
        <suiteXmlFile>testSuites\testng1.xml</suiteXmlFile> 
       </suiteXmlFiles> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-report-plugin</artifactId> 
      <version>2.15</version> 
     </plugin> 

與插件嘗試。

當然,你需要在你的pom中的testng和selenium依賴。

希望它有幫助。

相關問題