when setting chrome_type=CHROMIUM the wrong driver url is returned
def before_scenario(context, scenario): logging.info("RUNNING: " + scenario.name) print("Browser Test starting.\n") print("Setting chromedriver version and chrome options. ")
abs_path = get_project_root()
downloads_path = os.path.join(abs_path, 'downloads')
options = Options()
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
prefs = {"download.default_directory": downloads_path}
options.add_experimental_option("prefs", prefs)
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
if 'headless' in os.environ and os.environ['headless'] == '1':
options.headless = True
options.add_argument("--window-size=1920,1080")
**context.driver = webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install(), chrome_options=options)**
print("Currently using Chromedriver Version " + context.driver.capabilities['chrome']['chromedriverVersion'])
context.driver.maximize_window()
below is the debugger output:
Setting chromedriver version and chrome options.
[WDM] - Current chromium version is 85.0.4173
[WDM] - Get LATEST driver version for 85.0.4173
HOOK-ERROR in before_scenario: ValueError: There is no such driver by url http://chromedriver.storage.googleapis.com/LATEST_RELEASE_85.0.4173
there appears to be no release matching 85.0.4173 however, there is a release for 84.0.4173
There is mismatch between versions, 84 driver for 85 browser. It’s impossible to map this automatically. Put the version implicitly ChromeDriverManager(version=‘84.0.4173’).install()