From 6fd5dacf39da6834db1c92f339cd350a0a06cdf6 Mon Sep 17 00:00:00 2001 From: hassineabd Date: Mon, 17 Nov 2025 00:39:37 +0100 Subject: [PATCH] added argument: embedvideo can be set to false to make logs less heavy --- AppiumLibrary/keywords/_screenrecord.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/AppiumLibrary/keywords/_screenrecord.py b/AppiumLibrary/keywords/_screenrecord.py index 75d5cd88..c9c05eef 100644 --- a/AppiumLibrary/keywords/_screenrecord.py +++ b/AppiumLibrary/keywords/_screenrecord.py @@ -74,6 +74,9 @@ def stop_screen_recording(self, filename=None, **options): === Optional Args === + - ``embedVideo`` Set it to false to skip embedding the recorded video into log.html. + Applies to Android when no remotePath is provided. Defaults to true. + - ``remotePath`` The path to the remote location, where the resulting video should be \ uploaded. The following protocols are supported _http/https_, ftp. Null or empty \ string value (the default setting) means the content of resulting file should \ @@ -93,19 +96,20 @@ def stop_screen_recording(self, filename=None, **options): | `Stop Screen Recording` | filename=output | # saves the recorded session | """ if self._recording is not None: + embed_video = options.pop('embedVideo', True) self._recording = self._current_application().stop_recording_screen(**options) - return self._save_recording(filename, options) + return self._save_recording(filename, options, embed_video) else: raise RuntimeError("There is no Active Screen Record Session.") - def _save_recording(self, filename, options): + def _save_recording(self, filename, options, embed_video=True): path, link = self._get_screenrecord_paths(options, filename) decoded = base64.b64decode(self._recording) with open(path, 'wb') as screenrecording: screenrecording.write(decoded) # Embed the Screen Recording to the log file # if the current platform is Android and no remotePath is set. - if self._is_android() and not self._is_remotepath_set(options): + if embed_video and self._is_android() and not self._is_remotepath_set(options): self._html('' '