Issue with executing testngxml thru pomxml | Selenium Forum
K
kalyan Posted on 06/12/2018
I am trying to execute my tests thru maven. I've mentioned testng.xml in my pom.xml. But when i run from command prompt, maven doesn't consider the testng.xml mentioned in my pom.

Below is my pom.xml

<plugins>

  

      <plugin>

      <artifactId>maven-surefire-plugin</artifactId>

      <configuration>

      <suiteXmlFile>testng.xml</suiteXmlFile>

      <systemPropertyVariables>

         <buildnumber>${env.BUILD}</buildnumber>

         <engine>${env.ENGINE}</engine>

         <host>${env.HOST}</host>

      </systemPropertyVariables> 

      </configuration>

      </plugin>

    </plugins>


A
Ashish Thakur Replied on 09/12/2018

This works for me

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>

</plugins>
</build>