uttesh / pdfngreport

This is the pdf report plugin library written for testng/selenium frameworks, this listener will generate the pdf report on testcases execution, its very simple to configure no need to write any code.
http://uttesh.github.io/pdfngreport/
Other
30 stars 26 forks source link

I could not get the report #26

Open IlkerBekmezci opened 7 years ago

IlkerBekmezci commented 7 years ago

First of all thank you for your effort and sharing. But I could not run it properly. Without pdfngreport, I can run my framework properly. After adding the conf. mentioned in http://uttesh.com/pdfngreport/, i am getting the following error:

Report Location : C:/Users/Bekmezci/workspace/Test/pdfngreportFile Name : sample_pdf_report.pdf build system details : Build v2.0.8 - Bekmezci@E7450 - java 1.8.0_131(Oracle Corporation) - Windows 10(amd64) pdf report file path :C:\Users\Bekmezci\workspace\Test\pdfngreport\sample_pdf_report.pdf [INFO] [INFO] Results: [INFO] [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 19.206 s [INFO] Finished at: 2017-08-09T15:03:22+02:00 [INFO] Final Memory: 16M/220M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20:test (default-test) on project Test: There are test failures. [ERROR] [ERROR] Please refer to C:\Users\Bekmezci\workspace\Test\target\surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream. [ERROR] There was an error in the forked process [ERROR] org/apache/fop/apps/FopFactory [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process [ERROR] org/apache/fop/apps/FopFactory

uttesh commented 7 years ago

Thanks, looks like it's missing the dependent libraries. Check the sample pom file and add the missing dependencies and plugins

IlkerBekmezci commented 7 years ago

Yes, at first, I think in the same way . But nothing is missing and I have completed mvn depeendency::tree command successfully. For the last change, I am sending you my pom file. Its almost exacyly the same as in the example. (Only selenium dependency is added)

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 3:57 PM UTC Time: 9 August 2017 13:57 From: notifications@github.com To: uttesh/pdfngreport pdfngreport@noreply.github.com IlkerBekmezci ilkerbekmezci@protonmail.com, Author author@noreply.github.com

Thanks, looks like it's missing the dependent libraries. Check the sample pom file and add the missing dependencies and plugins

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

uttesh commented 7 years ago

In build log None of the test cases were executed, check the test case execution before generating the report.

IlkerBekmezci commented 7 years ago

Tests are executed. I see with my eyes that selenium tests are run properly. However in the console, it says test run:0.

Can the problem related with the paths? My paths are in the following:

pdfreport.report.logo.file=C:/Users/Bekmezci/Downloads/download.png

pdfreport.outputdir=C:/Users/Bekmezci/workspace/Test/pdfngreport

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 4:25 PM UTC Time: 9 August 2017 14:25 From: notifications@github.com To: uttesh/pdfngreport pdfngreport@noreply.github.com IlkerBekmezci ilkerbekmezci@protonmail.com, Author author@noreply.github.com

In build log None of the test cases were executed, check the test case execution before generating the report.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

t

uttesh commented 7 years ago

Remove the report Plugin and run, are you able to see test cases execution number? I suspect it's nothing to do with the report Plugin. Try to generate simply html report of your tests.

IlkerBekmezci commented 7 years ago

Without pdfngreport (listener in testng.xml), it works normally.

I think the error is the following:

[ERROR] java.lang.NoClassDefFoundError: org/apache/fop/apps/FopFactory

But, mvn dependency::tree is working properly. And i am using the same dependency in your github.

    <dependency>
        <groupId>org.apache.xmlgraphics</groupId>
        <artifactId>fop</artifactId>
        <version>2.0</version>
    </dependency>

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 4:37 PM UTC Time: 9 August 2017 14:37 From: notifications@github.com To: uttesh/pdfngreport pdfngreport@noreply.github.com IlkerBekmezci ilkerbekmezci@protonmail.com, Author author@noreply.github.com

Remove the report Plugin and run, are you able to see test cases execution number? I suspect it's nothing to do with the report Plugin. Try to generate simply html report of your tests.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

IlkerBekmezci commented 7 years ago

FYI,

In my Maven Dependencies directory in Eclipse, there is no org/apache/fop/apps/FopFactory

Only org/apache/fop/apps/Factory.

Can this be the problem?

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 5:01 PM UTC Time: 9 August 2017 15:01 From: ilkerbekmezci@protonmail.com To: uttesh/pdfngreport reply@reply.github.com

Without pdfngreport (listener in testng.xml), it works normally.

I think the error is the following:

[ERROR] java.lang.NoClassDefFoundError: org/apache/fop/apps/FopFactory

But, mvn dependency::tree is working properly. And i am using the same dependency in your github.

    <dependency>
        <groupId>org.apache.xmlgraphics</groupId>
        <artifactId>fop</artifactId>
        <version>2.0</version>
    </dependency>

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 4:37 PM UTC Time: 9 August 2017 14:37 From: notifications@github.com To: uttesh/pdfngreport pdfngreport@noreply.github.com IlkerBekmezci ilkerbekmezci@protonmail.com, Author author@noreply.github.com

Remove the report Plugin and run, are you able to see test cases execution number? I suspect it's nothing to do with the report Plugin. Try to generate simply html report of your tests.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

IlkerBekmezci commented 7 years ago

I am soosy. My mistake. FopFactory is there.

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 5:05 PM UTC Time: 9 August 2017 15:05 From: ilkerbekmezci@protonmail.com To: uttesh/pdfngreport reply@reply.github.com

FYI,

In my Maven Dependencies directory in Eclipse, there is no org/apache/fop/apps/FopFactory

Only org/apache/fop/apps/Factory.

Can this be the problem?

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 5:01 PM UTC Time: 9 August 2017 15:01 From: ilkerbekmezci@protonmail.com To: uttesh/pdfngreport reply@reply.github.com

Without pdfngreport (listener in testng.xml), it works normally.

I think the error is the following:

[ERROR] java.lang.NoClassDefFoundError: org/apache/fop/apps/FopFactory

But, mvn dependency::tree is working properly. And i am using the same dependency in your github.

    <dependency>
        <groupId>org.apache.xmlgraphics</groupId>
        <artifactId>fop</artifactId>
        <version>2.0</version>
    </dependency>

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 4:37 PM UTC Time: 9 August 2017 14:37 From: notifications@github.com To: uttesh/pdfngreport pdfngreport@noreply.github.com IlkerBekmezci ilkerbekmezci@protonmail.com, Author author@noreply.github.com

Remove the report Plugin and run, are you able to see test cases execution number? I suspect it's nothing to do with the report Plugin. Try to generate simply html report of your tests.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

IlkerBekmezci commented 7 years ago

Ok. this is my last chance. Test is working properly w/o pdf report. I am sending the whole console output. :( I think there is smt wrong with your latest implementation.

[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Test 1.0.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Test --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory C:\Users\Bekmezci\workspace\Test\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ Test --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Test --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory C:\Users\Bekmezci\workspace\Test\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ Test --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.17:test (default-test) @ Test --- [INFO] Surefire report directory: C:\Users\Bekmezci\workspace\Test\target\surefire-reports


T E S T S

Running TestSuite Report Location : C:/Users/Bekmezci/workspace/Test/pdfngreportFile Name : sample_pdf_report.pdf build system details : Build v2.0.8 - Bekmezci@E7450 - java 1.8.0_131(Oracle Corporation) - Windows 10(amd64) pdf report file path :C:\Users\Bekmezci\workspace\Test\pdfngreport\sample_pdf_report.pdf

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.345 s [INFO] Finished at: 2017-08-09T17:10:26+02:00 [INFO] Final Memory: 11M/224M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project Test: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed: There was an error in the forked process [ERROR] java.lang.NoClassDefFoundError: org/apache/fop/apps/FopFactory [ERROR] at com.uttesh.pdfngreport.handler.PdfReportHandler.generatePdfReport(PdfReportHandler.java:142) [ERROR] at com.uttesh.pdfngreport.PDFGenerator.generateReport(PDFGenerator.java:84) [ERROR] at com.uttesh.pdfngreport.PDFReportListener.generateReport(PDFReportListener.java:91) [ERROR] at org.testng.TestNG.generateReports(TestNG.java:1089) [ERROR] at org.testng.TestNG.run(TestNG.java:1048) [ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:293) [ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84) [ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:91) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) [ERROR] Caused by: java.lang.ClassNotFoundException: org.apache.fop.apps.FopFactory [ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:381) [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [ERROR] ... 11 more [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 5:06 PM UTC Time: 9 August 2017 15:06 From: ilkerbekmezci@protonmail.com To: uttesh/pdfngreport reply@reply.github.com

I am soosy. My mistake. FopFactory is there.

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 5:05 PM UTC Time: 9 August 2017 15:05 From: ilkerbekmezci@protonmail.com To: uttesh/pdfngreport reply@reply.github.com

FYI,

In my Maven Dependencies directory in Eclipse, there is no org/apache/fop/apps/FopFactory

Only org/apache/fop/apps/Factory.

Can this be the problem?

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 5:01 PM UTC Time: 9 August 2017 15:01 From: ilkerbekmezci@protonmail.com To: uttesh/pdfngreport reply@reply.github.com

Without pdfngreport (listener in testng.xml), it works normally.

I think the error is the following:

[ERROR] java.lang.NoClassDefFoundError: org/apache/fop/apps/FopFactory

But, mvn dependency::tree is working properly. And i am using the same dependency in your github.

    <dependency>
        <groupId>org.apache.xmlgraphics</groupId>
        <artifactId>fop</artifactId>
        <version>2.0</version>
    </dependency>

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 4:37 PM UTC Time: 9 August 2017 14:37 From: notifications@github.com To: uttesh/pdfngreport pdfngreport@noreply.github.com IlkerBekmezci ilkerbekmezci@protonmail.com, Author author@noreply.github.com

Remove the report Plugin and run, are you able to see test cases execution number? I suspect it's nothing to do with the report Plugin. Try to generate simply html report of your tests.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

uttesh commented 7 years ago

Please provide proper description, its not helping me to find what is the root cause. is there error in the build? attach full build log.

IlkerBekmezci commented 7 years ago

Honestly, I do not know how to browse build log. Where is it?

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 5:17 PM UTC Time: 9 August 2017 15:17 From: notifications@github.com To: uttesh/pdfngreport pdfngreport@noreply.github.com IlkerBekmezci ilkerbekmezci@protonmail.com, Author author@noreply.github.com

Please provide proper description, its not helping me to find what is the root cause. id there error in the build? attach full build log.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

uttesh commented 7 years ago

Ok its simple just run your mvn command and with save to file i.e. mvn clean install > testbuild.log, possible add the -e flag as well to get full stack trace.

is the sample demo is working for you? just re-tested library its working fine in all test scenarios.

IlkerBekmezci commented 7 years ago

Unfortunately, I cannot find a way to produce build log from eclipse. But I am quite sure that your code or your example maven project has bugs. I have achived to run Testng version (Even if it has also some problems. For example pdfngreport.jar version), but it is correctable.

However, your jar is not working with maven. After I run it from Testng. i also try to convert the project into maven from eclipse. However, after converting, it gave the same error.

Although it sounds illogical, this is the case.

I quit, I am out.

Best wishes to you..

Sent from ProtonMail, Swiss-based encrypted email.

-------- Original Message -------- Subject: Re: [uttesh/pdfngreport] I could not get the report (#26) Local Time: 9 August 2017 5:32 PM UTC Time: 9 August 2017 15:32 From: notifications@github.com To: uttesh/pdfngreport pdfngreport@noreply.github.com IlkerBekmezci ilkerbekmezci@protonmail.com, Author author@noreply.github.com

Ok its simple just run your mvn command and with save to file i.e. mvn clean install > testbuild.log

is the sample demo is working for you? just re-tested library its working fine in all test scenarios.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

uttesh commented 7 years ago

@IlkerBekmezci

Its very unfortunate that your unable to configure and library is not having any bug/issue relates to what your mentioning, lot of people are using and its easy to configure.

Unfortunately, I cannot find a way to produce build log from eclipse. But I am quite sure that your code or your example maven project has bugs. I have achived to run Testng version (Even if it has also some problems. For example pdfngreport.jar version), but it is correctable.

Please go through the sample of maven/gradle or ant to run out side eclipse. eclipse build will be useful in the development stage and to debug the build issue or anything related to build, its always good practice to build outside the eclipse. In real time finally we will integrate the test cases with build system to build the applications like jenkins etc.

Simple steps to run maven out side eclipse:

  1. Download maven from https://maven.apache.org/ and unzip the download file.
  2. Make sure maven is in the system path i.e. for windows set the environment system path with maven bin folder.
  3. Go to the sample code folder where pom.xml residing, open the command prompt on this location.
  4. Run maven command "mvn clean install" or "mvn clean test" according to that kind of build you need.

However, your jar is not working with maven. After I run it from Testng. i also try to convert the project into maven from eclipse. However, after converting, it gave the same error.

No need to do any conversion to maven, To make the development easy we provided a separate samples codes how to use the plugin for ant, maven and eclipse (http://uttesh.com/pdfngreport/).

Although it sounds illogical, this is the case. I quit, I am out. Best wishes to you..

Sorry to hear that, i have added this plugin just to make the other development easy to generate pdf report, no harm it will be useful to some one.

Sorry to write such big mail, just to make sure things are taken care properly.

Thanks,