extentreports-csharp icon indicating copy to clipboard operation
extentreports-csharp copied to clipboard

The screenshot in the log is without "src".

Open sisillV opened this issue 8 years ago • 6 comments

15-3-2017 - 11-52-59

Hi thank you for the new version :) I face difficulties with adding screenshot to the log: extest.Fail("message
", MediaEntityBuilder.CreateScreenCaptureFromPath("uploads/58c8281a1bb6df6bc46cac6d/58c8281f1bb6df6bc46cac6e/1.png").Build());

See in the picture that the image don't have "src" if I add manually "src" i see the picture as I expect.

15-3-2017 - 12-01-44withsrc

Am I doing something wrong? I am using Chrome browser; AventStack.ExtentReports-3.0.1 Nuget; extentx-community-1.0.1

I think that I found the place where the src stay empty:

namespace AventStack.ExtentReports.Model { public class ScreenCapture : Media { public string Source { get { return ""; } } } }

Is it on purpose? BR, Stanislava

sisillV avatar Mar 15 '17 10:03 sisillV

The return statement isn't empty for this version here. Are you able to view the screenshot in the HTML report?

PS. ExtentX currently does not implement log screenshots for both csharp and java versions.. its a to-be-added feature.

anshooarora avatar Mar 15 '17 19:03 anshooarora

1. When I use: extest.Fail("message
", MediaEntityBuilder.CreateScreenCaptureFromPath(DictionaryInteractions.ReportPropertiesDictionary["ReportPath"] + "/screenshot" + dateFormatFileNameStr + ".png").Build());

HTML Report The path point in folder where I save HTML Report and the screenshots on my C:. In this situation I see in HTML Report the screenshot 2 times. May be this is a issue that I see the picture twice. ExtentX Report I see this little icon and when I click it I don't see the screenshot.

2. When i use: extest.Fail("message
", MediaEntityBuilder.CreateScreenCaptureFromPath("uploads/58c8281a1bb6df6bc46cac6d/58c8281f1bb6df6bc46cac6e/1.png").Build());

HTML Report I see icon and when I click it I don't see the picture. ExtentX Report I see again the little icon like in the first screenshot and when I click it I see the picture.

Now I understand that adding a screenshot in ExtentX Report for logs is not ready. If I save my pictures in "uploads/" folder I will be able to see them in ExtentX. But this "src" will always stay empty and I will always see this little icon instead of the 10% width icon.

Is it possible to change this method to have src like this: ? return "<img data-featherlight='" + Path + "' width='10%' src='" + Path + "' data-src='" + Path + "'>";

Or if the feature will be ready soon?

P.S>Thank you for this great report!!!

sisillV avatar Mar 16 '17 08:03 sisillV

I am not able to reproduce it in the report. I only see 1 image for both test and log levels.. Can you create a sample code for me to test with?

ExtentX - it is currently an enhancement, but no ETA as of now..

anshooarora avatar Mar 21 '17 20:03 anshooarora

Hi - can you share a sample that I can use to reproduce images appearing twice in the HTML report?

anshooarora avatar Mar 23 '17 16:03 anshooarora

Hi anshooarora, Sorry for the late response. I attached simple solution see in \ExtentExImageTest\TestResultsExtendEx\ExtentExImageTest folder the html report with 2 pictures for every error.

ExtentExImageTest.zip

PS: You write me before: "The return statement isn't empty for this version here. Are you able to view the screenshot in the HTML report?" Actually the link point to method where the src is with value: '' See: return "<img data-featherlight='" + Path + "' width='10%' src='' data-src='" + Path + "'>"; If you fix this to: return "<img data-featherlight='" + Path + "' width='10%' src='" + Path + "' data-src='" + Path + "'>";

We will be able to see the picture with good size. BR, Stanislava

sisillV avatar Mar 27 '17 11:03 sisillV

I have the same problem and the src is empty. Looking into extent code I can see: public string Source { get { return ""; } } There is nothing in src. A nice feature to have would be to not have the width hardcoded here, and to specify from the report how big the thumbnail can be. Cause having it so small it's hard to click on it :D

Thanks, Alex

alexlazarciuc avatar Aug 04 '17 10:08 alexlazarciuc