Skip to content

Commit 739b540

Browse files
author
Tareq
committed
lowercased browser name and added else clause if termination of browser fails
1 parent 104c53d commit 739b540

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,15 +560,14 @@ def Open_Browser(dependency, window_size_X=None, window_size_Y=None, capability=
560560
browser_map = {
561561
"microsoft edge chromium": 'msedge',
562562
"chrome": "chrome",
563-
"fireFox": "firefox",
564563
"firefox": "firefox",
565-
"chromeHeadless": "chrome",
566-
"firefoxHeadless": "firefox",
567-
"edgeChromiumHeadless": "msedge",
564+
"chromeheadless": "chrome",
565+
"firefoxheadless": "firefox",
566+
"edgechromiumheadless": "msedge",
568567
}
569568

570569
if profile_options:
571-
if browser in browser_map.keys():
570+
if browser.strip().lower() in browser_map.keys():
572571
browser_short_form = browser_map[browser]
573572
process_status = browser_process_status(browser_short_form)
574573
for options in profile_options:
@@ -594,6 +593,10 @@ def Open_Browser(dependency, window_size_X=None, window_size_Y=None, capability=
594593
CommonUtil.ExecLog(
595594
sModuleInfo, f"Successfully terminated all the {browser_short_form}.exe processes", 1
596595
)
596+
else:
597+
CommonUtil.ExecLog(
598+
sModuleInfo, f"Could not terminate the {browser_short_form}.exe processes", 3
599+
)
597600
else:
598601
CommonUtil.ExecLog(
599602
sModuleInfo, f"ZeuZ does not support browser profile for {browser} browser", 3

0 commit comments

Comments
 (0)