The screenshot in the log is without "src".

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.

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
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.
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!!!
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..
Hi - can you share a sample that I can use to reproduce images appearing twice in the HTML report?
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.
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
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