Hi @anshooarora , I have observed when image converted to base64 and when base64 string is long, it (test execution) takes forever and screenshot doesn't attach to extent report.
Extent report fails to attach the screenshot when base64 String size is big that is something out of control to handle when it convert an image to base64. PLEASE DO PROVIDE SOME SOLUTION
Execution takes forever and fail to attach screenshot in extent report
scenario.write("<img src=data:image/png;base64," + base64String + ">");
Since there is a limitation of character in comment i am attaching base64String in attached zip file. There are 2 text file.
- Fail_base64_String_Size_is_Long
- Pass_base64_String
base64String.zip
=============================================
Here is the code i have in framework to capture the screenshot and attach to extent report as base64
TakesScreenshot screenshot = (TakesScreenshot) driver;
String base64Image = screenshot.getScreenshotAs(OutputType.BASE64);
scenario.write("<img src=data:image/png;base64," + base64Image + ">");
When i try with this code it seems screenshot is not getting attached to extent report even though base64 string is showing in cucumber.json and it does display in cucumber.html report
TakesScreenshot screenshot = (TakesScreenshot) WebDriverRunner.getWebDriver();
String base64Image = screenshot.getScreenshotAs(OutputType.BASE64);
byte[] htmlImage = ("<img class="col-lg-12" src="data:image/png;base64," + base64Image + "">").getBytes();
scenario().embed(htmlImage, "text/html");
It seems to log the result pass, fail along with screenshot using .embed is not working at all.
Hi @anshooarora , I have observed when image converted to base64 and when base64 string is long, it (test execution) takes forever and screenshot doesn't attach to extent report.
Extent report fails to attach the screenshot when base64 String size is big that is something out of control to handle when it convert an image to base64. PLEASE DO PROVIDE SOME SOLUTION
Execution takes forever and fail to attach screenshot in extent report
scenario.write("<img src=data:image/png;base64," + base64String + ">");
Since there is a limitation of character in comment i am attaching base64String in attached zip file. There are 2 text file.
base64String.zip
=============================================
Here is the code i have in framework to capture the screenshot and attach to extent report as base64
When i try with this code it seems screenshot is not getting attached to extent report even though base64 string is showing in cucumber.json and it does display in cucumber.html report
TakesScreenshot screenshot = (TakesScreenshot) WebDriverRunner.getWebDriver();
String base64Image = screenshot.getScreenshotAs(OutputType.BASE64);
byte[] htmlImage = ("<img class="col-lg-12" src="data:image/png;base64," + base64Image + "">").getBytes();
scenario().embed(htmlImage, "text/html");
It seems to log the result pass, fail along with screenshot using .embed is not working at all.