Can i embedd a screenshot in html report?[static html] | Selenium Forum
M
Posted on 05/02/2017
Sir,

This is getting to difficult to figure out..

I have extentreport...with a screenshot..in it.Now i need to mail this report for report+screenshot to stakeholders to see both of them.
Now when i mail the report, screenshot comes out blank..

Issue being, screenshot is not embedded into html report , N is referring a internal path to refer to screenshot.

i have following alternatives:

1>Embedd the screenshot into the html such that screenshot is also part of html [no references to external path]
2>Put the screenshot in the same path as report n mail it ..

[b:2lh3q88b]Sir , which option u think is best sir ?Am not even sure if 1st option is possible....[/b:2lh3q88b]

M
Replied on 05/02/2017

Am using cucumber-extentreports....Struck with scenario.embed(..) method...

Am using scenario.embed(data, "image/png"); to stick screenshot into report.Now few queries sir:

1>Can i specify path where the screenshot above is saved?
2>Can i specify the screenshot file name ?
3>Can i embed this screenshot in html report[So that its directly embedded into report [like static html] & does not point to any path of screenshot externally?

Referred some links:
https://groups.google.com/forum/#!topic/cukes/EwOmLFtAFzs

Refer code for comment:
The snippet I pasted doesn't save the image on disk - it embeds it straight into the page as a base64-encoded png. That allows you to move the html around (email, scp etc) without having to drag along additional image files.===============> [b:23gq6u09]This is the PROBLEM I NEED TO ADDRESS.[/b:23gq6u09]


M
Replied on 07/02/2017

[quote:2r61ofei]1>Can i specify path where the screenshot above is saved?
2>Can i specify the screenshot file name ?
3>Can i embed this screenshot in html report[So that its directly embedded into report [like static html] & does not point to any path of screenshot externally?[/quote:2r61ofei]

yes on all 3 question. use extent reports. or watch module 20 2016.