extentreports-cucumber4-adapter icon indicating copy to clipboard operation
extentreports-cucumber4-adapter copied to clipboard

How to attach log files to top of extent reports

Open skhandekar1 opened this issue 3 years ago • 1 comments

I want to attach my log files to my extent reports. I saw the following from @anshooarora, but it does not solve my issue completely

https://github.com/anshooarora/extentreports-java/issues/249

The problem is that the log gets attached to the last testcase that ran, since I put the command to attach log on my Extent Listener in onExecutionFinish() method:

	@Override
	public void onExecutionFinish() {
		ExtentLogger.logInfo("<a href='file:///C:/Users/skhandekar/eclipse-workspace/Nalu.CP.Automation/nalu-med-mob-app/Outputs/Execution Logs/ExecutionLog.log'>Execution Logs</a>");
		ExtentManager.getInstance().flush();
	}

I want my log to instead be attached on top of the reports as shown in the image below:

image

Any idea how this can be achieved? Thanks in advance!

skhandekar1 avatar Dec 19 '21 03:12 skhandekar1

With this I was able to attach the execution log to the Log view of the Extent reports, but I want it to be on the main page where all the test results are displayed:

String path = "<a href='file:///C:/Users/abc/eclipse-workspace/CP.Automation/med-mob-app/Outputs/Execution Logs/ExecutionLog.log'>Execution Logs</a>";
		extent.addTestRunnerOutput(path);

image

How can i put this in the desired location?

skhandekar1 avatar Dec 19 '21 22:12 skhandekar1