我有一个使用TestNG进行Selenium WebDriver测试的Maven项目。我想按组运行测试,这就是为什么在pom文件中具有surefire插件很重要,这就是我添加到pom文件中的原因:
如果我在使用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
我试图刷新和清理项目。我将项目移至另一台计算机,并且错误相同。互联网连接很好。我应该怎么办?
这是我的宝
<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中依赖于睾丸和硒。
希望能帮助到你。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句