extent-framework / extentreports-java

Extent Reporting Library, Java
http://extentreports.com
Apache License 2.0
226 stars 130 forks source link

When logging exception message and screenshot in extent report, it is coming side by side rather than one bye one line. #405

Open Snehaveeranna opened 1 year ago

Snehaveeranna commented 1 year ago

Dependency used:

<dependency>
     <groupId>com.aventstack</groupId>
    <artifactId>extentreports</artifactId>
     <version>5.0.9</version>
</dependency>

Sample code: ExtentTest.log(Status.FAIL, e.getMessage()); ExtentTest.log(Status.FAIL, " not found", MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshotpath).build()); Scenario 1: Where logs and screenshot are coming side by side.

image

Observation: 1.Issue obeserved when you have more number of lines in error message this issue is observed.

Scenario 2: When the above code are interchanged, i mean if screenshot is added first and logs are added at last then report is coming as blank. Attached screenshot for reference. Fig 1 is when the above code is interchanges as mentioned above. Fig 2. When ExtentTest.generateLog(Status.INFO, e.getMessage()) is used instead of normal log for error message. image

image

anshooarora commented 1 year ago

I'm unsure how this can be reproduced. Can you share a sample report file or project that reproduces this?

Snehaveeranna commented 1 year ago

I don't have that actually, issue can be reproduced when playwright uses autoscroll to identify the element and does multiple actions, like when you try to click on element which is hidden. Also, do we have any character limit between lines for each log?

anshooarora commented 1 year ago

No, I do not believe there is a character limit. I am still having a hard time understanding this issue and it would help if there is a sample I can look at, or a code snippet that I can use to reproduce this..