2013-09-23 47 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依赖。

希望它有帮助。

相关问题