[英]Maven doesn't build project with surefire plugin in pom
我有一個使用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中依賴於睾丸和硒。
希望能幫助到你。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.