Skip to content

Commit 57d5053

Browse files
committed
fixed it
1 parent 43946ab commit 57d5053

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Framework/Built_In_Automation/Web/Selenium/BuiltInFunctions.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,20 @@ def Open_Browser(browser, browser_options: BrowserOptions):
686686
service = Service()
687687
CommonUtil.ExecLog(sModuleInfo, "Using standard Chrome binaries", 1)
688688

689-
selenium_driver = webdriver.Chrome(
690-
service=service,
691-
options=options,
692-
)
689+
try:
690+
selenium_driver = webdriver.Chrome(
691+
service=service,
692+
options=options,
693+
)
694+
except SessionNotCreatedException as e:
695+
if "user data directory" in str(e).lower() and "already in use" in str(e).lower():
696+
options.add_argument(f"--no-sandbox")
697+
selenium_driver = webdriver.Chrome(
698+
service=service,
699+
options=options,
700+
)
701+
else:
702+
raise
693703

694704
# service = Service()
695705
# selenium_driver = webdriver.Chrome(

0 commit comments

Comments
 (0)