-1
我在一個maven項目中使用testng進行selenium自動化測試。 我想爲testng定義一個xml文件,以在POM.xml中運行,但它不起作用。請幫忙!如何在maven中設置POM.xml
這裏是我的pom.xml文件
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.33.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<version>2.12.4</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resource/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
首先,你要使用的插件的所有定義,是不完整的 - 沒有任何的artifactId。 – Mareen
在標籤suiteXMLFile之前,我添加 maven-surefire-plugin ,但它沒有工作 –