From 7be87df000471175c5c1028e367070bfcc67fe43 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Tue, 30 Oct 2018 12:25:41 -0400 Subject: [PATCH 1/3] Workaround for using a proxy server with auth in Chrome headless mode --- seleniumbase/core/browser_launcher.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/seleniumbase/core/browser_launcher.py b/seleniumbase/core/browser_launcher.py index de26382db0f..f04e0efc2ad 100755 --- a/seleniumbase/core/browser_launcher.py +++ b/seleniumbase/core/browser_launcher.py @@ -395,7 +395,13 @@ def get_local_driver( downloads_path, proxy_string, proxy_auth, proxy_user, proxy_pass) if headless: - chrome_options.add_argument("--headless") + # Headless Chrome doesn't support extensions, which are + # required when using a proxy server that has authentication. + # Instead, base_case.py will use PyVirtualDisplay when not + # using Chrome's built-in headless mode. See link for details: + # https://bugs.chromium.org/p/chromium/issues/detail?id=706008 + if not proxy_auth: + chrome_options.add_argument("--headless") chrome_options.add_argument("--disable-gpu") chrome_options.add_argument("--no-sandbox") if LOCAL_CHROMEDRIVER and os.path.exists(LOCAL_CHROMEDRIVER): From 3a3bad9d4730472981ee6a430d23491aaeb6ddfe Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Tue, 30 Oct 2018 12:28:17 -0400 Subject: [PATCH 2/3] Change default screen resolutions for browser windows --- seleniumbase/fixtures/base_case.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py index fbc81197fd3..62be3c77b90 100755 --- a/seleniumbase/fixtures/base_case.py +++ b/seleniumbase/fixtures/base_case.py @@ -2234,7 +2234,7 @@ def get_new_driver(self, browser=None, headless=None, if self.headless: # Make sure the invisible browser window is big enough try: - self.set_window_size(1920, 1200) + self.set_window_size(1440, 1080) self.wait_for_ready_state_complete() except Exception: # This shouldn't fail, but in case it does, @@ -2247,7 +2247,7 @@ def get_new_driver(self, browser=None, headless=None, if settings.START_CHROME_IN_FULL_SCREEN_MODE: self.driver.maximize_window() else: - self.driver.set_window_size(1250, 800) + self.driver.set_window_size(1250, 840) self.wait_for_ready_state_complete() except Exception: pass # Keep existing browser resolution @@ -2654,7 +2654,7 @@ def setUp(self): if self.headless: try: from pyvirtualdisplay import Display - self.display = Display(visible=0, size=(1920, 1200)) + self.display = Display(visible=0, size=(1440, 1080)) self.display.start() self.headless_active = True except Exception: From 77dde1e86a69d86ff668658fb2fdb1a30a70c0f3 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Tue, 30 Oct 2018 12:33:41 -0400 Subject: [PATCH 3/3] Version 1.16.17 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2da9b8a6b26..b2cee850420 100755 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ setup( name='seleniumbase', - version='1.16.16', + version='1.16.17', description='All-In-One Test Automation Framework', long_description=long_description, long_description_content_type='text/markdown',