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

Some times file is not getting generated and giving exception #16

Closed padmasri closed 8 years ago

padmasri commented 8 years ago

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.

  1. Close the file but still I am on the root folder of that file, that is test-output.
  2. 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

uttesh commented 8 years ago

@padmasri looks like permission issue on creating a file in your system, Access is denied exception is thrown. your system is having the restriction on create a new file,

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)

Solutions:

  1. Change the output location.
  2. Open command prompt in admin mode, and run the mvn from there instead of normal command prompt. how to open admin command prompt

Thanks,

padmasri commented 8 years ago

Thank you so much for your quick reply, I am able to generate the report with your steps provided above. appreciate your great work.