Skip to content

Commit d4c41d5

Browse files
committed
Treat the Chromium Edge browser like Chrome
1 parent 47f1b67 commit d4c41d5

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,12 @@ def get_driver(browser_name, headless=False, use_grid=False,
355355
'The format for using a proxy server with authentication '
356356
'is: "username:password@hostname:port". If using a proxy '
357357
'server without auth, the format is: "hostname:port".')
358-
if browser_name != constants.Browser.GOOGLE_CHROME:
358+
if browser_name != constants.Browser.GOOGLE_CHROME and (
359+
browser_name != constants.Browser.EDGE):
359360
raise Exception(
360-
"Chrome is required when using a proxy server that has "
361-
"authentication! (If using a proxy server without auth, "
362-
"either Chrome or Firefox may be used.)")
361+
"Chrome or Edge is required when using a proxy server "
362+
"that has authentication! (If using a proxy server "
363+
"without auth, Chrome, Edge, or Firefox may be used.)")
363364
proxy_string = validate_proxy_string(proxy_string)
364365
if proxy_string and proxy_user and proxy_pass:
365366
proxy_auth = True

seleniumbase/fixtures/base_case.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ def get_new_driver(self, browser=None, headless=None,
15021502
# WebDrivers can get closed during tearDown().
15031503
pass
15041504
else:
1505-
if self.browser == 'chrome':
1505+
if self.browser == 'chrome' or self.browser == 'edge':
15061506
width = settings.CHROME_START_WIDTH
15071507
height = settings.CHROME_START_HEIGHT
15081508
try:
@@ -1522,12 +1522,6 @@ def get_new_driver(self, browser=None, headless=None,
15221522
self.wait_for_ready_state_complete()
15231523
except Exception:
15241524
pass # Keep existing browser resolution
1525-
elif self.browser == 'edge':
1526-
try:
1527-
self.driver.maximize_window()
1528-
self.wait_for_ready_state_complete()
1529-
except Exception:
1530-
pass # Keep existing browser resolution
15311525
if self.start_page and len(self.start_page) >= 4:
15321526
if page_utils.is_valid_url(self.start_page):
15331527
self.open(self.start_page)
@@ -2299,9 +2293,10 @@ def assert_no_js_errors(self):
22992293
current_url = self.get_current_url()
23002294
raise Exception(
23012295
"JavaScript errors found on %s => %s" % (current_url, errors))
2302-
if self.demo_mode and self.browser == 'chrome':
2303-
messenger_post = ("ASSERT NO JS ERRORS")
2304-
self.__highlight_with_assert_success(messenger_post, "html")
2296+
if self.demo_mode:
2297+
if (self.browser == 'chrome' or self.browser == 'edge'):
2298+
messenger_post = ("ASSERT NO JS ERRORS")
2299+
self.__highlight_with_assert_success(messenger_post, "html")
23052300

23062301
def __activate_html_inspector(self):
23072302
self.wait_for_ready_state_complete()

0 commit comments

Comments
 (0)