grasshopper7 / extentreports-cucumber7-adapter

Cucumber-JVM 7 Adapter for Extent Framework
https://ghchirp.online/3196/
MIT License
17 stars 7 forks source link

Error while generating excel extent report "The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook" #31

Closed prtraj2 closed 10 months ago

prtraj2 commented 10 months ago

While running our regression suite, consisting of 900+ test cases, I see that excel extent reports are not getting generated and exception message crops up in the tearDown method. Can you check?

Aug 08, 2023 1:46:13 PM tech.grasshopper.reporter.ExtentExcelCucumberReporter flush SEVERE: An exception occurred java.lang.IllegalStateException: The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook at org.apache.poi.xssf.model.StylesTable.createCellStyle(StylesTable.java:860) at org.apache.poi.xssf.usermodel.XSSFWorkbook.createCellStyle(XSSFWorkbook.java:788) at tech.grasshopper.excel.report.cell.CellOperations.createCellStyle(CellOperations.java:108) at tech.grasshopper.excel.report.cell.CellOperations.createCellsWithStyleInRange(CellOperations.java:125) at tech.grasshopper.excel.report.table.AttributeFeatureScenarioTable.writeTableValues(AttributeFeatureScenarioTable.java:45) at tech.grasshopper.excel.report.sheets.attributes.AttributesSheet.updateAttributesFeatureScenarioTableData(AttributesSheet.java:123) at tech.grasshopper.excel.report.sheets.attributes.AttributesSheet.updateSheet(AttributesSheet.java:59) at tech.grasshopper.excel.report.workbook.ReportWorkbook.updateSheets(ReportWorkbook.java:77) at tech.grasshopper.excel.report.workbook.ExecutionAndTagAndFailSkipDataReport.updateSheets(ExecutionAndTagAndFailSkipDataReport.java:20) at tech.grasshopper.excel.report.workbook.ReportWorkbook.createReport(ReportWorkbook.java:46) at tech.grasshopper.reporter.ExtentExcelCucumberReporter.flush(ExtentExcelCucumberReporter.java:70) at tech.grasshopper.reporter.ExtentExcelCucumberReporter.access$100(ExtentExcelCucumberReporter.java:18) at tech.grasshopper.reporter.ExtentExcelCucumberReporter$1.onNext(ExtentExcelCucumberReporter.java:45) at tech.grasshopper.reporter.ExtentExcelCucumberReporter$1.onNext(ExtentExcelCucumberReporter.java:37) at io.reactivex.rxjava3.subjects.PublishSubject$PublishDisposable.onNext(PublishSubject.java:310) at io.reactivex.rxjava3.subjects.PublishSubject.onNext(PublishSubject.java:226) at com.aventstack.extentreports.ReactiveSubject.onFlush(ReactiveSubject.java:83) at com.aventstack.extentreports.AbstractProcessor.onFlush(AbstractProcessor.java:85) at com.aventstack.extentreports.ExtentReports.flush(ExtentReports.java:279) at com.aventstack.extentreports.service.ExtentService.flush(ExtentService.java:47) at com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter.finishReport(ExtentCucumberAdapter.java:301) at com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter.access$600(ExtentCucumberAdapter.java:63) at com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter$8.receive(ExtentCucumberAdapter.java:137) at com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter$8.receive(ExtentCucumberAdapter.java:134) at io.cucumber.core.eventbus.AbstractEventPublisher.send(AbstractEventPublisher.java:51) at io.cucumber.core.eventbus.AbstractEventBus.send(AbstractEventBus.java:12) at io.cucumber.core.runtime.SynchronizedEventBus.send(SynchronizedEventBus.java:47) at io.cucumber.core.runtime.CucumberExecutionContext.emitTestRunFinished(CucumberExecutionContext.java:118) at io.cucumber.core.runtime.CucumberExecutionContext.finishTestRun(CucumberExecutionContext.java:105) at io.cucumber.testng.TestNGCucumberRunner.finish(TestNGCucumberRunner.java:145) at io.cucumber.testng.AbstractTestNGCucumberTests.tearDownClass(AbstractTestNGCucumberTests.java:57) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:69) at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:390) at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:325) at org.testng.internal.invokers.TestMethodWorker.invokeAfterClassConfigurations(TestMethodWorker.java:229) at org.testng.internal.invokers.TestMethodWorker.invokeAfterClassMethods(TestMethodWorker.java:215) at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:131) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.testng.TestRunner.privateRun(TestRunner.java:848) at org.testng.TestRunner.run(TestRunner.java:621) at org.testng.SuiteRunner.runTest(SuiteRunner.java:443) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:437) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:397) at org.testng.SuiteRunner.run(SuiteRunner.java:336) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1280) at org.testng.TestNG.runSuitesLocally(TestNG.java:1200) at org.testng.TestNG.runSuites(TestNG.java:1114) at org.testng.TestNG.run(TestNG.java:1082) at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66) at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)

grasshopper7 commented 10 months ago

ouch... seems like a bug in the code. i need to change the code to reuse styles rather than generate fresh for each cell. I will look into it.

grasshopper7 commented 10 months ago

Fixed in latest release. SHould be available in maven in a couple of days