Selenium webdriver for both versions of chrome 114 and 116

53 views Asked by At

With new changes with respect to 'Chrome for Testing' browser and corresponding chromedriver, I am aware that we need to use selenium 4.11.2 for chrome 116. However, I still need my tests to run on 114 as well. Is it possible to have single set of python code which runs on both chrome versions 114 and 116?

I tried below, it works sometimes but fails most of the time. Ideally it should have failed all the time but I am not sure why it works sometime. Please provide if you know better approach.

selenium==4.11.2 webdriver-manager==4.0.0

`from selenium import webdriver
from selenium.webdriver import ChromeOptions
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

options = ChromeOptions()
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)`
0

There are 0 answers