我有一個使用Maven和TestNG的Selenium項目。如何使用Maven POM文件運行testNG測試
我已經嘗試了幾種不同的方法讓我的測試運行Maven命令(我使用肯定的火插件)。 當我運行Maven時,測試不會運行。沒有錯誤。
有沒有人有一個很好的例子或教程,我可以按照使我的測試運行時,我使用mvn測試?
在此先感謝。
這裏是輸出:
C:\**************>mvn test
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - **************:**************:jar:1.0
[INFO] task-segment: [test]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\**************\src\test\res
ources
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Oct 02 15:14:10 BST 2012
[INFO] Final Memory: 16M/38M
[INFO] ------------------------------------------------------------------------
而且從我的POM文件的萬無一失的配置:
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>iso-8859-1</encoding>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/main/test_suites/local/***_Test.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
你能夠運行你的testng XML嗎?你在XML中有什麼內容?另外,我相信***在xml名稱中是pom中的一些實際正確值。 –
user64139,你找到了這個問題的答案嗎?我遇到同樣的問題,下面的答案不能解決問題。 –