def get_new_driver(self, browser=None, headless=None,<EOL>servername=None, port=None, proxy=None, agent=None,<EOL>switch_to=True, cap_file=None, disable_csp=None):
if self.browser == "<STR_LIT>" and self.servername == "<STR_LIT:localhost>":<EOL><INDENT>raise Exception('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>browserstack_ref = (<EOL>'<STR_LIT>')<EOL>sauce_labs_ref = (<EOL>'<STR_LIT>')<EOL>if self.browser == "<STR_LIT>" and not self.cap_file:<EOL><INDENT>raise Exception('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>% (browserstack_ref, sauce_labs_ref))<EOL><DEDENT>if browser is None:<EOL><INDENT>browser = self.browser<EOL><DEDENT>browser_name = browser<EOL>if headless is None:<EOL><INDENT>headless = self.headless<EOL><DEDENT>if servername is None:<EOL><INDENT>servername = self.servername<EOL><DEDENT>if port is None:<EOL><INDENT>port = self.port<EOL><DEDENT>use_grid = False<EOL>if servername != "<STR_LIT:localhost>":<EOL><INDENT>use_grid = True<EOL><DEDENT>proxy_string = proxy<EOL>if proxy_string is None:<EOL><INDENT>proxy_string = self.proxy_string<EOL><DEDENT>user_agent = agent<EOL>if user_agent is None:<EOL><INDENT>user_agent = self.user_agent<EOL><DEDENT>if disable_csp is None:<EOL><INDENT>disable_csp = self.disable_csp<EOL><DEDENT>if self.demo_mode or self.masterqa_mode:<EOL><INDENT>disable_csp = True<EOL><DEDENT>if cap_file is None:<EOL><INDENT>cap_file = self.cap_file<EOL><DEDENT>valid_browsers = constants.ValidBrowsers.valid_browsers<EOL>if browser_name not in valid_browsers:<EOL><INDENT>raise Exception("<STR_LIT>"<EOL>"<STR_LIT>" % (browser, valid_browsers))<EOL><DEDENT>from seleniumbase.core import browser_launcher<EOL>new_driver = browser_launcher.get_driver(browser_name=browser_name,<EOL>headless=headless,<EOL>use_grid=use_grid,<EOL>servername=servername,<EOL>port=port,<EOL>proxy_string=proxy_string,<EOL>user_agent=user_agent,<EOL>cap_file=cap_file,<EOL>disable_csp=disable_csp)<EOL>self._drivers_list.append(new_driver)<EOL>if switch_to:<EOL><INDENT>self.driver = new_driver<EOL>if self.headless:<EOL><INDENT>try:<EOL><INDENT>self.set_window_size(<NUM_LIT>, <NUM_LIT>)<EOL>self.wait_for_ready_state_complete()<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if self.browser == '<STR_LIT>' or self.browser == '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>self.driver.set_window_size(<NUM_LIT>, <NUM_LIT>)<EOL>self.wait_for_ready_state_complete()<EOL><DEDENT>except Exception:<EOL><INDENT>pass  <EOL><DEDENT><DEDENT>elif self.browser == '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>self.driver.maximize_window()<EOL>self.wait_for_ready_state_complete()<EOL><DEDENT>except Exception:<EOL><INDENT>pass  <EOL><DEDENT><DEDENT><DEDENT><DEDENT>return new_driver<EOL>
This method spins up an extra browser for tests that require
            more than one. The first browser is already provided by tests
            that import base_case.BaseCase from seleniumbase. If parameters
            aren't specified, the method uses the same as the default driver.
            @Params
            browser - the browser to use. (Ex: "chrome", "firefox")
            headless - the option to run webdriver in headless mode
            servername - if using a Selenium Grid, set the host address here
            port - if using a Selenium Grid, set the host port here
            proxy - if using a proxy server, specify the "host:port" combo here
            switch_to - the option to switch to the new driver (default = True)