Closed
Description
Request Type: Requirement
Keyword: Capture Page Screenshot EMBED
Details:
- We would like to show error screenshot in
TEST MESSAGE
section. This helps in quick analysis
Approach:
Adjusting code like below in screenshot.py
helps to return base64
path
def _capture_page_screen_to_log(self):
screenshot_as_base64 = self.driver.get_screenshot_as_base64()
self._embed_to_log_as_base64(screenshot_as_base64, 800)
return screenshot_as_base64 # old: return EMBED
Usage In Robot:
We display base64 image in TEST MESSAGE
section
*** Settings ***
Library SeleniumLibrary run_on_failure=Capture Embed Screenshot
*** Keywords ***
Capture Embed Screenshot
${path}= Capture Page Screenshot EMBED
Set Test Message *HTML* <img src="data:image/png;base64,${path}" width="800px"> append=${True}