Core_Hybrid_Framework | Selenium Forum
M
Posted on 21/02/2016
Hi Ashish,

I imported module21 core hybrid framework to my eclipse and i followed your video instructions but i am getting a error when i use mvn site can you plz suggest me how to resolve this issue?
PFA

M
Replied on 21/02/2016

reporty ng has been deprecated 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 22/02/2016

I am trying to run your module 21 Core_Hybrid_Framework project 2015 but its giving following Errors.
I am done following steps:
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>

======>i put above ExtentReporterNG in my testng.xml and i changed package name and my code in testng.xml is below.

<suite name="My suite" parallel="tests">
<listeners>
<listener class-name="com.qtpselenium.framework.util.ExtentReporterNG" />
<listener class-name="com.qtpselenium.framework.util.CustomListener" />
</listeners>
<suite-files>
<suite-file path="./Suite_A.xml" />
<suite-file path="./Suite_B.xml" />
</suite-files>
</suite>

4. Add dependency in you POM.xml
<!-- Extent Reports -->
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.04</version>
</dependency>

======>Added above dependency in POM.xml

5. now open cmd prompt and go to your project location and run command "mvn compile" and after it run "mvn package"
======> I opened cmd and run the command "mvn compile" Result "Build Success" & after i run "mvn package" it gives "Build failure".
the error see below file attachment.

and one more i copied the "ExtentReporterNG" class from above link and i gave my package name also but its showing errors(Red lines) in below imports of class.

import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;

just give me a good solution to run.

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.

Responsive image

M
Replied on 22/02/2016

now that problem is fixed its giving different problem.


please check keywords.java


M
Replied on 23/02/2016

i have faced same issue as you have mentioned below.. did some google search and fixed as per the below steps and then able to generate ExtentReports using Maven:


1. Navigate to this link :http://relevantcodes.com/extentreports-for-selenium/
2. Click on the link = ExtentReports Java 2.40.2 (8548) , jars gets downloaded
3. Add these jars to your Project , so that the relevantcodes import class error will be resolved
4. Now update the dependency in pom.xml as mentioned below:
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.40.2</version>
</dependency>
5. From here follow the steps mentioned by Ashish ie.
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 23/02/2016

Laxmi Reddy thanks for your response.
Laxmi Reddy i followed your steps till step6. both "mvn compile", "mvn package" are gave the build success in cmd. But when i am running testng.xml its giving below error as in screen shot. Could you plz give me a solution to this error.
This is my testng.xml code. when i am running this code i am getting a error as below screen shot.
and what are changes i need to do after importing core hybrid framework 2015 march project?
Can you plz share your mail id bcoz i have small doubts on this project?

<suite name="My suite" parallel="tests">
<listeners>
<listener class-name="com.qtpselenium.framework.util.ExtentReporterNG" />
<listener class-name="com.qtpselenium.framework.util.CustomListener" />
</listeners>
<suite-files>
<suite-file path="./Suite_A.xml" />
<suite-file path="./Suite_B.xml" />
</suite-files>
</suite>

Responsive image

M
Replied on 23/02/2016

remove the customlistener from the testing.xml as at this moment it is not required.
<listener class-name="com.qtpselenium.framework.util.CustomListener" />

As per your screenshot the error states that file is not found, please check once the files are located in the correct path as mentioned in your code.