Skip to content

Commit 223d322

Browse files
SHAKIBSHAKIB
authored andcommitted
install and manage chromeDriver with webdriver_manager for electron app launch
1 parent 24587df commit 223d322

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ def Open_Electron_App(data_set):
425425
try:
426426
desktop_app_path = ""
427427
driver_id = ""
428+
chrome_version = ""
428429
for left, _, right in data_set:
429430
left = left.replace(" ", "").replace("_", "").replace("-", "").lower()
430431
if "windows" in left and platform.system() == "Windows":
@@ -435,6 +436,8 @@ def Open_Electron_App(data_set):
435436
desktop_app_path = right.strip()
436437
elif left == "driverid":
437438
driver_id = right.strip()
439+
elif left == "chrome:version":
440+
chrome_version = right.strip()
438441

439442
if not desktop_app_path:
440443
CommonUtil.ExecLog(
@@ -463,9 +466,9 @@ def Open_Electron_App(data_set):
463466
opts.binary_location = desktop_app_path
464467
opts.add_argument("--remote-debugging-port=9222")
465468
# service = Service(executable_path=electron_chrome_path)
466-
p = '/Users/test/Downloads/chromedriver-mac-arm64/chromedriver'
469+
driver_bin_path = ChromeDriverManager(driver_version=chrome_version).install()
467470

468-
service = Service(p)
471+
service = Service(driver_bin_path)
469472
selenium_driver = webdriver.Chrome(options=opts, service=service)
470473
selenium_driver.implicitly_wait(0.5)
471474
CommonUtil.ExecLog(sModuleInfo, "Started Electron App", 1)

0 commit comments

Comments
 (0)