I have written C# code to get base64 encoded string as a screenshot and place it into .html Extent Report.
private ExtentReports Extent;
private ExtentTest Test;
------- some other code here ----------
Test = Extent.CreateTest("name of my test as string");
public void AddTestFailureScreenshot(string base64ScreenCapture)
{
Test.AddScreenCaptureFromBase64String(base64ScreenCapture, "Screenshot on Error:");
}
public string ScreenCaptureAsBase64String()
{
ITakesScreenshot ts = (ITakesScreenshot)driver;
Screenshot screenshot = ts.GetScreenshot();
return screenshot.AsBase64EncodedString;
}
When the report is generated in .html format, I can't see the embedded screenshot right away, rather I need to click on base64-img link and then image loads normally (image shows that one of our pre-prod environment is down)
This happens in Firefox and Google Chrome. I am just trying to figure out if the problem with Extent Reports code that I have provided, or some configuration in the browser itself.
Has anybody faced a similar problem before? I simply want screenshots to appear without any additional clicking.