Closed nikhilGupta24 closed 6 years ago
Due to the changes in Klov and the Extent Framework, you will have to use a new instance of MongoDb and Klov specifically for version 4. Any data stored in your instance created in version 3 will cause issues.
Please drop all version 3 data, or use a new instance and update us if issues persist. Although, this exact issue is a known one caused due to Extent Framework upgrade and changes in schema as well as the underlying models/theme.
Hi Anshoo,
Thanks for the reply.
I did drop the whole DB and tried on a fresh schema, it still gives the same issue. Extent works fine. (4.0.1)
Tried with the latest version of MongoDB, but the issue persists.
Any more workarounds you can suggest on the same ?
Would be highly obliged if we have some fixes for the aforementioned issue soon. :)
Thanking you Regards Nikhil
Is it possible to share the report created from Extent?
I suspect something invalid in your tests because the NPE is coming from because the only argument here (status) is null:
at com.aventstack.klov.viewdefs.Color.byStatus(Color.java:8) ~[classes!/:0.2.0]
I am fixing this (use v0.2.1
so the NPE does not arise, but I would also suggest sharing a report with us.
Hi
Thanks for the prompt reply !
Attaching the sample extent report. (The screenshots were populating perfectly) -- removed them from the sample report due to company policy.
Regards Nikhil SampleExtentReport.zip
Hi
Got the below error while running the 0.2.1 jar for Klov
2018-11-27 01:09:09.749 ERROR 10280 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
Field sender in com.aventstack.klov.mail.MailService required a bean of type 'org.springframework.mail.javamail.JavaMailSender' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.mail.javamail.JavaMailSender' in your configuration.
Regards Nikhil
Please uncomment spring.mail.host
and spring.mail.port
in application.properties
. Or, use the copy from the repo here.
Hi
Applied the fixes and now using Klov-0.2.1
The Klov sever responds properly but it does not log anything in regards to the child test (attached to the Parent test) -- Refer the Extent reports attached previously.
Attaching a screenshot :
-- (using MongoDB shell version v4.0.4)
Regards Nikhil
It's really hard to know what is happening with your looking at your code. These screenshots do not help at all.
@anshooarora I suggest mandating users to provide the relevant info along with code to debug such issues. I will send in a pull request for issue-template, please merge.
Hi
Sending in the Code snippets :
static ExtentTest test;
static ExtentTest parentTest;
static ExtentReports extent;
static ExtentKlovReporter klov;
static ExtentHtmlReporter htmlReporter;
//Initialising the HTML and the Klov reporter
public void initialiseKlovReporter() {
extent = new ExtentReports();
htmlReporter = new ExtentHtmlReporter("target/extent_" + ManageEnvironment.getEnv() + "_" + System.currentTimeMillis() + ".html");
klov = new ExtentKlovReporter();
klov.initMongoDbConnection("localhost");
klov.initKlovServerConnection("http://localhost");
klov.setProjectName(ManageEnvironment.getEnv());
klov.setReportName("Test run : " + TestUtil.getNowPlusMinutes(0));
extent.attachReporter(htmlReporter, klov);
}
//Initialising the Parent Test
public void startReportGen() {
parentTest = extent.createTest(currentUseCase + " | " + ManageEnvironment.getEnv());
parentTest.assignCategory("Use Case");
}
//Initialising the child test
test = parentTest.createNode(currentUseCase + " || " + currentTestCase + " || ");
//This method is used for logging
public void addToReport(List<LinkedHashMap<String, String>> testData) {
try {
screenshotname = currentSequence.toString() + "_" + currentAction + System.currentTimeMillis();
captureScreen(TestHelper.getDriver(), screenshotname);
MediaEntityModelProvider mediaModel = MediaEntityBuilder.createScreenCaptureFromPath("screenshots/" + currentUseCase + "/" + currentTestCase + "/" + screenshotname + ".png").build();
setLogInfo(testData);
if (errorToggle.equals("FAIL") || CommonUtility.getErrorStatus() == false) {
test.fail(logInfo, mediaModel);
} else {
test.pass(logInfo, mediaModel);
}
} catch (UncheckedIOException uce) {
uce.getLocalizedMessage();
} catch (Exception e) {
e.printStackTrace();
e.getLocalizedMessage();
}
}
extent.flush();
I hope this helps out in debugging...
Regards Nikhil
No luck in reproducing this. Is JavaScript enabled for you? Do you see any errors in console?
Hi
I am using MongoDB version 3.2.20 Klov - 0.2.0 Extent Reports - 4.0.1
Previously was using : klov - 0.1.1 | Extent Reports 3.1.6-SNAPSHOT
The connect between the reports were perfectly fine. Once i upgraded the Reporting module to the newer versions of Extent and Klov, Extent gives (html Reporter) a perfect report Klov opens up but without the Dashboard fullt updated and no details about the tests.
Attaching the Klov stack-trace.
What all things do i need to keep in mind while upgrading the reporting stack ?? Are there any version controls, i am missing out on ??..
And what would be perfect way to upgrade the Reporting stack ?
Clicking on any of the builds seen in the screenshot, does not lead to anything, The server hangs.
P.S : The below mentioned initialization also does not compile. : ExtentReporter extent = new ExtentReports();
Thanking you Regards Nikhil
[Uploading Klov StrackTrace.txt…]()``
` Error executing FreeMarker template
freemarker.core._TemplateModelException: Java method "com.aventstack.klov.viewdefs.Color.byStatus(String)" threw an exception when invoked on com.aventstack.klov.viewdefs.Color object "com.aventstack.klov.viewdefs.Color@5d7be03e"; see cause exception in the Java stack trace.
FTL stack trace ("~" means nesting-related):
Failed at: ${Color.byStatus(project.lastReport.s... [in template "project.select.ftl" at line 46, column 117]
Caused by: java.lang.NullPointerException: null at com.aventstack.klov.viewdefs.Color.byStatus(Color.java:8) ~[classes!/:0.2.0] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_51] at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_51] at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1505) ~[freemarker-2.3.28.jar!/:2.3.28] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:72) ~[freemarker-2.3.28.jar!/:2.3.28] ... 105 common frames omitted
2018-11-19 18:28:54.266 ERROR 18856 --- [tp2146338580-33] freemarker.runtime : Error executing FreeMarker template
freemarker.core._TemplateModelException: Java method "com.aventstack.klov.viewdefs.Color.byStatus(String)" threw an exception when invoked on com.aventstack.klov.viewdefs.Color object "com.aventstack.klov.viewdefs.Color@5a4a955"; see cause exception in the Java stack trace.
FTL stack trace ("~" means nesting-related):
Failed at: ${Color.byStatus(project.lastReport.s... [in template "project.select.ftl" at line 46, column 117]
Caused by: java.lang.NullPointerException: null at com.aventstack.klov.viewdefs.Color.byStatus(Color.java:8) ~[classes!/:0.2.0] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_51] at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_51] at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1505) ~[freemarker-2.3.28.jar!/:2.3.28] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:72) ~[freemarker-2.3.28.jar!/:2.3.28] ... 105 common frames omitted
2018-11-19 18:28:58.950 WARN 18856 --- [tp2146338580-14] org.eclipse.jetty.server.HttpChannel : /project/select
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is freemarker.core._TemplateModelException: Java method "com.aventstack.klov.viewdefs.Color.byStatus(String)" threw an exception when invoked on com.aventstack.klov.viewdefs.Color object "com.aventstack.klov.viewdefs.Color@5d7be03e"; see cause exception in the Java stack trace.
FTL stack trace ("~" means nesting-related):
Failed at: ${Color.byStatus(project.lastReport.s... [in template "project.select.ftl" at line 46, column 117]
Caused by: freemarker.core._TemplateModelException: Java method "com.aventstack.klov.viewdefs.Color.byStatus(String)" threw an exception when invoked on com.aventstack.klov.viewdefs.Color object "com.aventstack.klov.viewdefs.Color@5d7be03e"; see cause exception in the Java stack trace.
FTL stack trace ("~" means nesting-related):
Failed at: ${Color.byStatus(project.lastReport.s... [in template "project.select.ftl" at line 46, column 117]
Caused by: java.lang.NullPointerException: null at com.aventstack.klov.viewdefs.Color.byStatus(Color.java:8) ~[classes!/:0.2.0] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_51] at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_51] at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1505) ~[freemarker-2.3.28.jar!/:2.3.28] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:72) ~[freemarker-2.3.28.jar!/:2.3.28] ... 105 common frames omitted
2018-11-19 18:28:58.974 WARN 18856 --- [tp2146338580-33] org.eclipse.jetty.server.HttpChannel : /project/select
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is freemarker.core._TemplateModelException: Java method "com.aventstack.klov.viewdefs.Color.byStatus(String)" threw an exception when invoked on com.aventstack.klov.viewdefs.Color object "com.aventstack.klov.viewdefs.Color@5a4a955"; see cause exception in the Java stack trace.
FTL stack trace ("~" means nesting-related):
Failed at: ${Color.byStatus(project.lastReport.s... [in template "project.select.ftl" at line 46, column 117]
Caused by: freemarker.core._TemplateModelException: Java method "com.aventstack.klov.viewdefs.Color.byStatus(String)" threw an exception when invoked on com.aventstack.klov.viewdefs.Color object "com.aventstack.klov.viewdefs.Color@5a4a955"; see cause exception in the Java stack trace.
FTL stack trace ("~" means nesting-related):
Failed at: ${Color.byStatus(project.lastReport.s... [in template "project.select.ftl" at line 46, column 117]
Caused by: java.lang.NullPointerException: null at com.aventstack.klov.viewdefs.Color.byStatus(Color.java:8) ~[classes!/:0.2.0] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_51] at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_51] at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1505) ~[freemarker-2.3.28.jar!/:2.3.28] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:72) ~[freemarker-2.3.28.jar!/:2.3.28] ... 105 common frames omitted`