I am running a Docker image from a Docker container in AWS Batch environment. It was all working nicely for a while now, but since today I am getting the following error.
E selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This
version of ChromeDriver only supports Chrome version 114
E Current browser version is 116.0.5845.96 with binary path /opt/google/chrome/google-chrome
The Dockerfile that has the chrome installation is as below
FROM python:3.10
WORKDIR /usr/src/app
COPY . .
RUN pip install --trusted-host pypi.org --upgrade pip
RUN pip install --no-cache-dir \
--extra-index-url https://artifactory.int.csgdev01.citcosvc.com/artifactory/api/pypi/citco-
pypi/simple \
-r requirements.txt
RUN pip install awscli
RUN apt-get install -yqq unzip curl
RUN apt-get -y update
RUN apt-get install zip -y
RUN apt-get install unzip -y
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >>
/etc/apt/sources.list.d/google-chrome.list RUN apt-get -y update RUN apt-get -y install -y google-chrome-stable
# Install chrome driver
RUN wget -N https://chromedriver.storage.googleapis.com/`curl -sS
chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip -P ~/
RUN unzip ~/chromedriver_linux64.zip -d ~/
RUN rm ~/chromedriver_linux64.zip
RUN mv -f ~/chromedriver /usr/local/bin/chromedriver
RUN chmod 0755 /usr/local/bin/chromedriver
RUN ls -lt
RUN ls -lt /usr/local/bin
RUN chmod +x ./run.sh
CMD ["bash", "./run.sh"]
My selenium python test class is below
from selenium import webdriver
import unittest
class Test_SecTransferWorkflow(unittest.TestCase):
options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument("--enable-javascript")
options.add_argument("--start-maximized")
options.add_argument("--incognito")
options.add_argument('--headless')
options.add_argument('--ignore-certificate-errors')
options.add_argument('--enable-features=NetworkService')
options.add_argument('--shm-size=1g')
options.add_argument('--disable-gpu')
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_argument("--window-size=1920,1080")
options.add_argument("--disable-extensions")
options.add_argument('--disable-dev-shm-usage')
options.add_experimental_option('useAutomationExtension', False)
options.add_experimental_option("detach", True)
options.add_argument('--allow-running-insecure-content')
options.add_argument('--allow-insecure-localhost')
options.add_argument('--ignore-ssl-errors=yes')
options.add_argument('--user-agent=Chrome/77')
driver = webdriver.Chrome(options=options)
@classmethod
def setUpClass(cls):
try:
cls.driver.delete_all_cookies()
cls.driver.get(TestData_common.BASE_URL)
time.sleep(2)
except WebDriverException as e:
print('Site down...> ', e)
cls.driver.delete_all_cookies()
time.sleep(3)
def test_001_login(self):
if not TestData_common.URL_FOUND:
pytest.skip('Site seems to be down...')
self.loginPage = LoginPage(self.driver)
self.loginPage.do_click_agree_button()
self.driver.maximize_window()
print('Successfully clicked on AGREE button...')
time.sleep(2)
I didn't have any issues running this image so far, until I encountered this error today. Any help is much appreciated.
.deb
file for the version you want to install -- see: here for more info. You can also find the Chromedriver downloads for 116 here: googlechromelabs.github.io/chrome-for-testing/#stable – Xerophthalmia