Skip to content

Requirement: Return embed screenshot path while using Capture Page Screenshot #1934

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
adiralashiva8 opened this issue Apr 3, 2025 · 1 comment
Assignees

Comments

@adiralashiva8
Copy link

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}
    
@adiralashiva8
Copy link
Author

This is duplicate of #1923 PR 97ca29b

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants