Skip to content

Commit

Permalink
Return base64 image in case of EMBED
Browse files Browse the repository at this point in the history
This can be useful in case if someone wants to reuse the image i.e set test message or set suite documentation
  • Loading branch information
hsj51 authored Oct 7, 2024
1 parent 038af54 commit 97ca29b
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 97ca29b

Please sign in to comment.