From 1b7d5ed60df224bb9945a05d254dda86ddf983eb Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Tue, 1 Apr 2025 07:36:39 -0400 Subject: [PATCH] [IMP] script selenium: feature to take screenshot --- script/selenium/selenium_lib.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/script/selenium/selenium_lib.py b/script/selenium/selenium_lib.py index 3eb353f..92c33dd 100644 --- a/script/selenium/selenium_lib.py +++ b/script/selenium/selenium_lib.py @@ -42,6 +42,12 @@ class SeleniumLib(object): ) self.driver = None + def do_screenshot(self): + if self.config.scenario_screenshot: + self.driver.save_screenshot( + f"./screenshots/{self.config.scenario}_{str(int(time.time() * 10000))}.png" + ) + def configure(self, ignore_open_web=False): # Configuration pour lancer Firefox en mode de navigation privée firefox_options = webdriver.FirefoxOptions()