def create_driver(self, browser_name, url): if browser_name == "chrome": self.driver = webdriver.Chrome( executable_path=globals.CHROME_DRIVER) elif browser_name == "firefox": self.driver = webdriver.Firefox( executable_path=globals.FIREFOX_DRIVER) self.driver.maximize_window() self.driver.get(url) self.driver.implicitly_wait(ReadConfig.get_implicit_wait()) return self.driver
def start_browser(browser_name, url): driver = None if browser_name == "Chrome" or browser_name == "chrome": driver = webdriver.Chrome(executable_path=globals.CHROME_PATH) elif browser_name == "Firefox" or browser_name == "firefox": driver = webdriver.Firefox(executable_path=globals.FIREFOX_PATH) driver.implicitly_wait(ReadConfig.get_implicit_wait()) driver.maximize_window() driver.get(url) return driver
def start_browser(browser_name, url): driver = None if browser_name == "chrome" or browser_name == "Chrome": options = webdriver.ChromeOptions() options.add_argument("--start-maximized") options.add_argument("--disable-infobars") driver = webdriver.Chrome(options=options, executable_path=constants.CHROME_PATH) elif browser_name == "firefox" or browser_name == "Firefox": driver = webdriver.Firefox(executable_path=constants.FIREFOX_PATH) driver.get(url) driver.implicitly_wait(ReadConfig.get_implicit_wait()) return driver