Hi Members,
I am very new to this forum. I am trying to run a particular group of tests
from testng.
I have to groups of tests: *first* and *second*.

*testng.xml:
----------*
/<!DOCTYPE suite SYSTEM &quot;http://testng.org/testng-1.0.dtd&quot; >
<suite name="Suite 1">
  <test name="testNG test1">
    <classes>
       <class name="com.prac1.MyFirstTest"/>
    </classes>
        <groups>
                <run>
                        <include name="first"/>
                </run>
        </groups>
  </test>
</suite>
/
*pom.xml:
--------*
/<?xml version="1.0" encoding="UTF-8"?>
<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>vnath</groupId>
    <artifactId>Student</artifactId>
    <version>2.0</version>
        <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
 
    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8</version>
                        
        </dependency>
    </dependencies>
 
    <build>
                <testResources>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
                </testResources>
        <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugin</groupId>
                                <artifactId>maven-surefire-plugin</artifactId>
                                <version>2.5.1</version>
                                <configuration>
                                        
<testSourceDirectory>src/test/java</testSourceDirectory>
                                        <suiteXmlFiles>
                                                
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                                        </suiteXmlFiles>                        
                
                                </configuration>                                
                        </plugin>
        
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <version>2.5.1</version>
                                <configuration>
                                        <suiteXmlFiles>
                                                
<suiteXmlFile>${basedir}/src/test/resources/testng.xml</suiteXmlFile>
                                        </suiteXmlFiles> 
                                </configuration>                                
            </plugin>              
                </plugins>
    </build>
</project>/

*Project structure:
----------------*

   Student
          |
          |---src
          |     |---main
          |     |      |----java
          |     |      |       |--com
          |     |      |             |--prac
          |     |      |                   |--Student.java
          |     |      |----resources
          |     |
          |     |
          |     |---test
          |             |---java
          |             |       |---com
          |             |               |---prac1
          |             |                       |---MyFirstTest.java
          |             |
          |             |---resources
          |                      |---testng.xml
          |
          |----pom.xml



When I ran *mvn test* command, It executed all the test groups but I am
expecting only "first" test group tests to be run. 

What is the problem in the above pom.xml or testng.xml?

Please help me.

Thanks in advance,
Vishwanath


















--
View this message in context: 
http://maven.40175.n5.nabble.com/Unable-to-run-a-particular-test-group-in-testng-tp5762745.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to