Skip to content

Commit e13832b

Browse files
committed
fix: mac test webdriver config
1 parent 3ff6814 commit e13832b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

sample/Tests/test/test_mac.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,20 @@ def login(cls):
9292
# Set up Chrome options to connect to the existing Chrome instance
9393
chrome_options = Options()
9494
chrome_options.add_experimental_option("debuggerAddress", "localhost:9222")
95+
96+
# Explicitly specify ChromeDriver path and Chrome browser path for macOS
97+
from selenium.webdriver.chrome.service import Service
98+
chromedriver_path = "/usr/local/bin/chromedriver"
99+
chrome_path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
100+
101+
# Set Chrome as the browser binary
102+
chrome_options.binary_location = chrome_path
103+
104+
# Create service with explicit ChromeDriver path
105+
service = Service(executable_path=chromedriver_path)
106+
95107
# Connect to the existing Chrome instance
96-
cls.seleniumdriver = webdriver.Chrome(options=chrome_options)
108+
cls.seleniumdriver = webdriver.Chrome(service=service, options=chrome_options)
97109

98110
print("Open a window on Chrome")
99111

0 commit comments

Comments
 (0)