Git Product home page Git Product logo

uttesh / pdfngreport Goto Github PK

View Code? Open in Web Editor NEW
30.0 15.0 26.0 100.83 MB

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.

Home Page: http://uttesh.github.io/pdfngreport/

License: Other

Java 74.18% XSLT 25.82%
testng pdf-report pom ant listener selenium selenium-java java

pdfngreport's Issues

[Enhancement] Ability to add Company Name/Label

Reports would look more customized if it could contain company logo or product info kind of thing.
for example If automation is for a client FLIPKART then a logo of FLIPKART would make report more pro.

Pie chart is not visible on my report

Hi,

I have added the pdfreport.pie.chart.type=normal and pdfreport.chart=show in my pdfng properties file but still i cannot see the pie chart can someone please tell me what is missing.I also added all the necessary jar files.Please help me resolve this issue.

Thanks in advance.

Enhancement Request: Add Lines below title

Hi Uttesh,

In my current project, higher management want the details like device name, os and build version and environment name, so if possible can you please provide a way through which I can enter those details below title.

Like you provide for entering title :pdfreport.title.text
same way three more lines for entering details below title

Please help

Thanks & Regards
Smit Jain

I could not get the report

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

Ant build.xml is giving issue

Hi I am running my Test Case through Ant build.xml

I am getting given issue:

[testng] Error on line 70 of :
[testng] Cannot find a matching 2-argument function named {http://xml.apache.org/xslt/java}format()
[testng] ; SystemID: ; Line#: 70; Column#: -1
[testng] net.sf.saxon.trans.DynamicError: Cannot find a matching 2-argument function named {http://xml.apache.org/xslt/java}format()
[testng] at net.sf.saxon.expr.ErrorExpression.evaluateItem(ErrorExpression.java:53)
[testng] at net.sf.saxon.expr.ErrorExpression.iterate(ErrorExpression.java:66)
[testng] at net.sf.saxon.expr.Atomizer.iterate(Atomizer.java:99)
[testng] at net.sf.saxon.expr.FirstItemExpression.evaluateItem(FirstItemExpression.java:81)

Please find given my build.xml

<property name="test.dir" location="src" />
<property name="lib.dir" location="ext-lib" />
<property name="classes.dir" location="build" />



<path id="classpath.test">
    <fileset dir="${lib.dir}">
        <include name="**/*.jar"/>
    </fileset>
    <pathelement location="${classes.dir}" />
</path>

<!-- ==================== Clean Target ==================== -->
<target name="clean" description="Delete build and packaging directories">
    <delete includeEmptyDirs="true" failonerror="false">
        <fileset dir="${testng.output.dir}"/>
    </delete>

    <delete dir="${classes.dir}" />
</target>

<!-- ==================== Compile Target ==================== -->
<target name="compile-test" depends="clean">
    <mkdir dir="${classes.dir}"/>
    <javac srcdir="${test.dir}" destdir="${classes.dir}" verbose="false" includeantruntime="true">
        <classpath refid="classpath.test" />
    </javac>
</target>


<!-- ==================== runTestNG Target ==================== -->
<target name="runTestNG" depends="compile-test">
    <testng classpathref="classpath.test" useDefaultListeners="false"  haltonfailure="false">
        <xmlfileset dir="." includes="TestNG2.xml" />
    </testng>
</target>

Please help

I am defining pdfreport listeners in my TestNG.xml file

Thanks & Regards
Smit Jain
9663310652

i need support in doing BDD

hi uttesh,
iam yamuna.i am doing pdf report generation for test cases. i done for testng and now i need to do for bdd can you please help me or give me suggestions for doing in bdd.

Displaying wrong time for test case execution

Hi Uttesh,

I have used your code to generate pdf reports and it is working properly. Problem i am facing is

Test case execution time is wrong. I have 5 test cases I am execution in 12345 order but in report it is displaying in 42351 and also displaying wrong execution time

I need the pie chart for parallel running from multiple mobile devices

Hi author, may i know can the pie chart sort by different mobile devices's test cases instead of all test cases of different mobile devices group together in one pie chart. Because i'm running the test case with multiple mobile devices. So if the pie chart shown one by one of each mobile devices then should be look nice. Hope you can take it in consideration and implement it in next version. I'm looking forward for your reply. Thank you.

Uploading image.png…

PDF isn't exported when running with Maven

Hi Uttesh,

I have an issue when running PDF NG Report. I try to run project by Run As TestNG, the report is exported correctly. But it's not ok when Run As Maven Test.

Here is my POM & testng files:
pomNtestng.zip

Please help me to find out the problem.
Many thanks!

I can't generate the report

Hi Uttesh,
Firstly, thank you for your post it has been very helpful for me. I have tried to run a test case with the pdfngreport library, however after I did all settings, in the different files (pom.xml, pdfngreport.properties) the test case runs correctly, but the report is not generated, even the console does not shows any information or error regarding to the report. I am using jfreechart 1.0.13, fop 2.0, pdfngreport 2.1.3 for me project. I also have run your example on my machine (pdfngreportdemo-master) and this running successful but with my project doesn't work. How can I know that over my project the library is working correctly? , Do I have some logs or something similar where I can see that everything is configure in the correct way?

Thank for your attention and I hope you can help me with this.

Environment name

hi,
how can we setup to print the environment the tests are run in report
thanks.

Embed screenshots in report

Is there a way to embed screenshots in report or provide link ?

In my case I take screenshots on test case failure .

What's the way to configure this option ?

Exception Summary Page Not Required

Hi Uttesh,

There is no issue in your code. Your PDF reporting code is very use full for me.

I have a request. Is it possible that in the PDF report the Exception summary page will not come.

In Exception summary your PDF report is giving correct result, but for us is we need to send the report to higher management with Pass, failed and Skipped results, but with out Exception Summary.

Please help

Thanks & Regards
Smit Jain
9663310652

File is getting error while generating the pdf even the case is also passes

Can you please help in this regard,

Oct 06, 2016 11:47:26 AM com.uttesh.pdfngreport.PDFReportListener generateReport
SEVERE: null
com.uttesh.pdfngreport.exceptionHandler.ReportException: Failed generating PDF report.
at com.uttesh.pdfngreport.PDFGenerator.generateReport(PDFGenerator.java:88)
at com.uttesh.pdfngreport.PDFReportListener.generateReport(PDFReportListener.java:91)
at org.testng.TestNG.generateReports(TestNG.java:1089)
at org.testng.TestNG.run(TestNG.java:1048)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
Caused by: java.lang.NullPointerException
at com.uttesh.pdfngreport.util.pdf.GenerateTable.populateColumnHeader(GenerateTable.java:247)
at com.uttesh.pdfngreport.util.pdf.GenerateTable.generate(GenerateTable.java:63)
at com.uttesh.pdfngreport.util.pdf.SuccessTable.populateData(SuccessTable.java:40)
at com.uttesh.pdfngreport.util.pdf.SuccessTable.populateSingleTableData(SuccessTable.java:58)
at com.uttesh.pdfngreport.PDFGenerator.getTable(PDFGenerator.java:149)
at com.uttesh.pdfngreport.PDFGenerator.populatePassedListTable(PDFGenerator.java:97)
at com.uttesh.pdfngreport.PDFGenerator.generateReport(PDFGenerator.java:71)
... 6 more

not showing pie chart and company logo

hi,
when i run tests on my local machine piechart & logo are displaying properly, but on bamboo CI piechart & logo are not displaying. i have the logo saved in project directory with path.
Any thoughts? would help

Pie chart is not visible on my report

Hi uttesh,

I have added the pdfreport.pie.chart.type=explode in my pdfng properties file but still i cannot see the pie chart can someone please tell me what is missing.I also added all maven dependencies in POM.xml.Please help me resolve this issue.

Thank you.

Does PDFNGReport work with BDD?

Hi Uttesh,

Thank you so much for your efforts on this.

I just have a question, PDFNG report does work with BDD? Earlier I was using this with TDD - TestNG, now I need to use this with BDD Cucumber.

Much appreciate your help on this.

Regards,
Padma.

Screenshots for failed test cases are not created automatically

Hi Uttesh,

I am using your PDF Report generation listener, really thanks to have this contribution it helps a lot.

In pdfngreport.properties file I have enabled the selenium user configuration.

Below setting only for selenium user for selenium failed screen shot link show related

pdfreport.show.selenium.screenshot.link=show
pdfreport.selenium.failed.test.screenshot.outputdir=D:/Selenium/Projects/PDFReport/FailScreenshotNew

But screenshots are not created automatically in specified folder so that in report it's not linked obviously. Please guide me to proceed further with this.

Thanks,
Kalai.

Some times file is not getting generated and giving exception

Hi Uttesh,

Some times it is not generating the PDF and getting the below exception. I am on windows 7 os. and work space is in C:/Users/xxxx/workspace/project/test-output
Scenario: 1. I did maven install and when I check in test-output folder for the file and open the file and see the test results.
2. Close the file but still I am on the root folder of that file, that is test-output.
3. Do mvn clean install, tests are running fine but below is the exception and file is not generating.

Hope you can help with this issue.

Jun 15, 2016 9:45:51 AM com.uttesh.pdfngreport.PDFReportListener generateReport
SEVERE: null
com.uttesh.pdfngreport.exceptionHandler.ReportException: Failed generating PDF report.
at com.uttesh.pdfngreport.PDFGenerator.generateReport(PDFGenerator.java:88)
at com.uttesh.pdfngreport.PDFReportListener.generateReport(PDFReportListener.java:91)
at org.testng.TestNG.generateReports(TestNG.java:1135)
at org.testng.TestNG.run(TestNG.java:1081)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: java.io.IOException: Access is denied
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1012)
at com.uttesh.pdfngreport.PDFGenerator.createFile(PDFGenerator.java:121)
at com.uttesh.pdfngreport.PDFGenerator.generateReport(PDFGenerator.java:65)
... 9 more

How to add relative path to pdfngreport.properties file

Hi Uttesh,

When I am trying to give relative path for Logo and pdf report location, the file is not getting generated and getting the below error. When I give full path like below it is working fine
For Logo: C://Users//padma//workspace//projectname//src//resources//image//IPLogo.png
For Report location: C://Users//padma//workspace//projectname//test-output//pdfngreport//

Issue is if I give relative path like below
pdfreport.report.logo.file=..//src//resources//images//IPLogo.png
pdfreport.outputdir=..//test-output//pdfngreport//


ERROR main- Image not found. URI: file:/..//src//resources//images//IPLogo.png (No context info available)
ERROR main- Image not found. URI: file:/.//pdfngreport///chart.png. (No context info available)

Dynamic test name in the report

Hi Uttesh,

I am using data provider to generate multiple runs of the same test and want each run to have a unique name in the report.
Please find the attachment for your reference.

Pdf Report.docx

File path error running in Mac or Linus

Hi Uttesh,

There is a configuration problem for running the plugin in Mac or Linux. For Linux, I changed the Constants.FORWARD_SLASH to “/” and in the report.xsl file, I changed the url(file:/{ReportLocation}/chart.png) to url(ReportLocation/chart.png).

My project currently running one test case for a large number of times, using the InvocationCount in TestNG. I just wonder if possible to retrieve the count of each test case run and present it in the PDF report.

Thanks a lot for the wonderful plugin and looking forward to future releases.

xslt errors on executing if another xslt jar exist

On executing with a project with another xslt report type it gives xslt error as conflicts happens and another jar file gets picked.

Solution - Just simply remove all other xslt jar file from the project referenced lib and project will start working.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.