Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Return base64 image in case of EMBED #1923

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/SeleniumLibrary/keywords/screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def capture_page_screenshot(self, filename: str = DEFAULT_FILENAME_PAGE) -> str:
format string syntax].

An absolute path to the created screenshot file is returned or if
``filename`` equals to EMBED, word `EMBED` is returned.
``filename`` equals to EMBED, base64 image is returned.

Support for EMBED is new in SeleniumLibrary 4.2

Expand Down Expand Up @@ -126,7 +126,7 @@ def _capture_page_screenshot_to_file(self, filename):
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 EMBED
return screenshot_as_base64

@keyword
def capture_element_screenshot(
Expand Down Expand Up @@ -173,7 +173,7 @@ def _capture_element_screenshot_to_file(self, element, filename):

def _capture_element_screen_to_log(self, element):
self._embed_to_log_as_base64(element.screenshot_as_base64, 400)
return EMBED
return element.screenshot_as_base64

@property
def _screenshot_root_directory(self):
Expand Down
Loading