Could not be resolved:ort for org.reportyng:reporty-ng | Selenium Forum
M
Posted on 01/07/2016
[7/1/2016 10:53:01 PM] Sumanta Jena: Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project DataDrivenFramework_TestNG: failed to get repPlugin org.reportyng:reporty-ng:1.2 or one of its dependencies could not be resolved:ort for org.reportyng:reporty-ng: Could not find artifact org.reportyng:reporty-ng:jar:1.2 in reporty-ng (https://github.com/cosminaru/reporty-ng/raw/master/dist/maven) -> [Help 1]
[7/1/2016 10:53:37 PM] Sumanta Jena: I am getting this error while running mvn test site using command prompt

mvn test site failed. However mvn test has successful. Can you please guide me to solve this issue

M
Replied on 01/07/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.40.1</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 02/07/2016

Thanks for info. Do you have a video that solves this issue. Can you please share video class that solves this issue.


M
Replied on 02/07/2016

not yet but working on it.


M
Replied on 06/07/2016

Ashish,

Can you please share working code to generate "extentreports" in maven. I need to implement extentreports in my projects.
please help me on this as I am not able to implement maven because of reporty ng has been deprecated.

Thanks,
Sumanta


M
Replied on 06/07/2016

were the above steps not helpful?


M
Replied on 08/07/2016

Ashish,

I should remove testng-xslt-report plugin from pom.xml file right ?


<!-- TestNG-xslt related configuration. -->

<!-- <plugin>
<groupId>org.reportyng</groupId>
<artifactId>reporty-ng</artifactId>
<version>1.2</version>
<configuration>

<outputdir>/target/testng-xslt-report</outputdir>
<sorttestcaselinks>true</sorttestcaselinks>
<testdetailsfilter>FAIL,SKIP,PASS,CONF,BY_CLASS</testdetailsfilter>
<showruntimetotals>true</showruntimetotals>
</configuration>
</plugin> -->


Added com.relevantcodes dependancy in pom.xml file

<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.40.1</version>
</dependency>

Do I need to add any extentreports plugin in pom.xml file?

please advice me on this.


M
Replied on 08/07/2016

[quote="sumanta.mcg":2oqlbx1b]Ashish,

I should remove testng-xslt-report plugin from pom.xml file right ?


<!-- TestNG-xslt related configuration. -->

<!-- <plugin>
<groupId>org.reportyng</groupId>
<artifactId>reporty-ng</artifactId>
<version>1.2</version>
<configuration>

<outputdir>/target/testng-xslt-report</outputdir>
<sorttestcaselinks>true</sorttestcaselinks>
<testdetailsfilter>FAIL,SKIP,PASS,CONF,BY_CLASS</testdetailsfilter>
<showruntimetotals>true</showruntimetotals>
</configuration>
</plugin> -->

[/quote:2oqlbx1b]
yes, you can remove them if you like.


[quote="sumanta.mcg":2oqlbx1b]
Added com.relevantcodes dependancy in pom.xml file

<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.40.1</version>
</dependency>

Do I need to add any extentreports plugin in pom.xml file?

please advice me on this.[/quote:2oqlbx1b]
just add dependency and add this listener in your project.

[code:2oqlbx1b]// 2.40.1+
import java.io.File;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.testng.IReporter;
import org.testng.IResultMap;
import org.testng.ISuite;
import org.testng.ISuiteResult;
import org.testng.ITestContext;
import org.testng.ITestResult;
import org.testng.xml.XmlSuite;

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

public class ExtentReporterNG implements IReporter {
private ExtentReports extent;

@Override
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {
extent = new ExtentReports(outputDirectory + File.separator + "Extent.html", true);

for (ISuite suite : suites) {
Map<String, ISuiteResult> result = suite.getResults();

for (ISuiteResult r : result.values()) {
ITestContext context = r.getTestContext();

buildTestNodes(context.getPassedTests(), LogStatus.PASS);
buildTestNodes(context.getFailedTests(), LogStatus.FAIL);
buildTestNodes(context.getSkippedTests(), LogStatus.SKIP);
}
}

extent.flush();
extent.close();
}

private void buildTestNodes(IResultMap tests, LogStatus status) {
ExtentTest test;

if (tests.size() > 0) {
for (ITestResult result : tests.getAllResults()) {
test = extent.startTest(result.getMethod().getMethodName());

test.setStartedTime(getTime(result.getStartMillis()));
test.setEndedTime(getTime(result.getEndMillis()));

for (String group : result.getMethod().getGroups())
test.assignCategory(group);

if (result.getThrowable() != null) {
test.log(status, result.getThrowable());
}
else {
test.log(status, "Test " + status.toString().toLowerCase() + "ed");
}

extent.endTest(test);
}
}
}

private Date getTime(long millis) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(millis);
return calendar.getTime();
}
}[/code:2oqlbx1b]

add call your test from testng.xml
[code:2oqlbx1b]<suite name="SuiteName">
<listeners>
<listener class-name="package.ExtentReporterNG" />
</listeners>
<test name="Test" allow-return-values="true">
<classes>
<class name="package.class" />
</classes>
</test>
</suite>[/code:2oqlbx1b]


M
Replied on 09/07/2016

Ashish,

I have followed exactly same steps. Please find my project attached.
Can you kindly guide me where I have done mistakes.

Thanks a lot for your advice and suggestion.

Best Regards,
Sumanta


M
Replied on 09/07/2016

Ashish,

I have followed exactly same steps that you have suggested.But still not able to generate XSLT report in my project.
I have attached my project here . Can you please take a look on it.


Thanks a lot for your advice and suggestion.

Best Regards,
Sumanta


M
Replied on 09/07/2016

your report is at

Core_WebDriver_DataDriven_Framework\test-output\[color=#FF0000:e5u40api]Extent.html[/color:e5u40api]


M
Replied on 09/07/2016

Got that. Thanks Ashish for your help and support.