From 24587df6e66c6a1661fe97c2cd1ca26be280edee Mon Sep 17 00:00:00 2001 From: test Date: Thu, 13 Nov 2025 20:43:52 +0600 Subject: [PATCH 1/3] electron app temp chromedriver path and remote debugging port added --- .../Built_In_Automation/Web/Selenium/BuiltInFunctions.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py b/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py index 57cad6984..d2ad5b04f 100644 --- a/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py +++ b/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py @@ -461,7 +461,12 @@ def Open_Electron_App(data_set): opts = Options() opts.binary_location = desktop_app_path - selenium_driver = webdriver.Chrome(opts, Service()) + opts.add_argument("--remote-debugging-port=9222") + # service = Service(executable_path=electron_chrome_path) + p = '/Users/test/Downloads/chromedriver-mac-arm64/chromedriver' + + service = Service(p) + selenium_driver = webdriver.Chrome(options=opts, service=service) selenium_driver.implicitly_wait(0.5) CommonUtil.ExecLog(sModuleInfo, "Started Electron App", 1) Shared_Resources.Set_Shared_Variables("selenium_driver", selenium_driver) From 223d322edb6cacf08956b01ec7f0526adbfbea99 Mon Sep 17 00:00:00 2001 From: SHAKIB Date: Wed, 19 Nov 2025 12:04:40 +0600 Subject: [PATCH 2/3] install and manage chromeDriver with webdriver_manager for electron app launch --- .../Built_In_Automation/Web/Selenium/BuiltInFunctions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py b/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py index d2ad5b04f..68e3c5801 100644 --- a/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py +++ b/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py @@ -425,6 +425,7 @@ def Open_Electron_App(data_set): try: desktop_app_path = "" driver_id = "" + chrome_version = "" for left, _, right in data_set: left = left.replace(" ", "").replace("_", "").replace("-", "").lower() if "windows" in left and platform.system() == "Windows": @@ -435,6 +436,8 @@ def Open_Electron_App(data_set): desktop_app_path = right.strip() elif left == "driverid": driver_id = right.strip() + elif left == "chrome:version": + chrome_version = right.strip() if not desktop_app_path: CommonUtil.ExecLog( @@ -463,9 +466,9 @@ def Open_Electron_App(data_set): opts.binary_location = desktop_app_path opts.add_argument("--remote-debugging-port=9222") # service = Service(executable_path=electron_chrome_path) - p = '/Users/test/Downloads/chromedriver-mac-arm64/chromedriver' + driver_bin_path = ChromeDriverManager(driver_version=chrome_version).install() - service = Service(p) + service = Service(driver_bin_path) selenium_driver = webdriver.Chrome(options=opts, service=service) selenium_driver.implicitly_wait(0.5) CommonUtil.ExecLog(sModuleInfo, "Started Electron App", 1) From 985170022e91abddd87306a9b0df13350217a967 Mon Sep 17 00:00:00 2001 From: mdshakib007 Date: Wed, 19 Nov 2025 13:02:32 +0600 Subject: [PATCH 3/3] Environment variable added fro arch differentiate in webdriver_manager --- .../Built_In_Automation/Web/Selenium/BuiltInFunctions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py b/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py index 68e3c5801..4c70fee7e 100644 --- a/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py +++ b/Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py @@ -466,6 +466,14 @@ def Open_Electron_App(data_set): opts.binary_location = desktop_app_path opts.add_argument("--remote-debugging-port=9222") # service = Service(executable_path=electron_chrome_path) + arch = platform.machine().lower() + if platform.system() == "Darwin" and arch == "arm64": + os.environ['WDM_ARCHITECTURE'] = 'arm64' + elif platform.system() == "Windows" and arch not in ("amd64", "x86_64"): + os.environ['WDM_ARCHITECTURE'] = 'x32' + else: + os.environ['WDM_ARCHITECTURE'] = 'x64' + driver_bin_path = ChromeDriverManager(driver_version=chrome_version).install() service = Service(driver_bin_path)