Not able to generate xslt reports in maven | Selenium Forum
M
Posted on 14/01/2016
i m attaching here the screenshots and pom.xml.
and even i m not able to run all test cases only app test is running.
please help
regards
rudransh
(anjali.mishra02@gmail.com)

M
Replied on 14/01/2016

reports ng has been depreacted you cannot make xslt reports from maven you have to use ANT.

if you are not using ANT and want to make good looking reports with maven use this

1. go to this link <http://relevantcodes.com/testng-listener-using-extentreports/>
2. create class "ExtentReporterNG". This is Listener class and put second block code in it from upper link and save it.
3. put ExtentReporterNG this listener in your testneg.xml. change package name with your package name.
<listeners>
<listener class-name="package.ExtentReporterNG" />
</listeners>
4. Add dependency in you POM.xml
<!-- Extent Reports -->
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.04</version>
</dependency>

5. now open cmd prompt and go to your project location and run command "mvn compile" and after it run "mvn package"
6. go in eclipse and refresh your project and run your testng.xml
7. after running refresh your project and check report in test output folder.
8. a folder generate with your class name. check extent.html in it and open this in web browser.


M
Replied on 29/02/2016

Hi Ashish ,
Thanks for replying.I ll go thru it.
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 29/02/2016

in testng.xml how many test cases have you added?