Unable to execute all the testcases thru maven only AppTest | Selenium Forum
M
Posted on 14/01/2016
Hi Ashish ,
Thanks for replying for previous post.I ll go thru that.
Here I am attaching screen shots Please find the below attachment.
As i am unable to run all the tests thru this,only AppTest is running please review and let me know.
Steps which i followed:
1.I created a maven project.
2. I created a new source folder (src/test/resource ) and copied testng.xml(changed the package name as required.)inside it.
3.Added plugins tag in pom.xml as given below:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.maventwo</groupId>
<artifactId>learntestng</artifactId>
<version>1</version>
<packaging>jar</packaging>

<name>learntestng</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.10</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<!-- Skip the normal tests, we'll run them in the integration-test phase -->
<skip>true</skip>


</configuration>


</plugin>
</plugins>
</build>




</project>
4.I gave mvn compile,then mvn eclipse:eclipse,then mvn test site,then mvn test commands inside command prompt.
5.Every time build is successfull but only Apptest class is getting executed.
Please let me know where am i wrong.
Thanks and Regards
Anjali
anjali.mishra02@gmail.com

M
Replied on 14/01/2016

[code:3uu8p2ax]!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="com.mavenone">
<listeners>
<listener class-name="testng_listeners.CustomListener" />
</listeners>
<test name="AppTest">
<classes>
<class name="com.mavenone.AppTest" ></class>
</classes>
</test>
<test name="Sampletest">
<classes>
<class name="com.mavenone.sampletest" ></class>
</classes>
</test>
</suite>
[/code:3uu8p2ax]

add the test name and classes in above testng.xml that you want to execute.