image: maven:3.9.1pipelines: default: name: Execute tests trigger: automatic caches: - maven script: - mvn clean install '-Dspring.profiles.active=${environmentName}' -DsuiteFileName=$testSuite -Dthreads=$threadsCount services: - selenium-chromedefinitions: services: selenium-chrome: image: selenium/standalone-chrome:3.141.59-oxygen
<span>/root/.m2/repository/webdriver/chromedriver/linux64/114.0.5735.90/chromedriver: error while loading shared libraries: libglib-2.0.so.0: cannot open shared object file: No such file or directory</span>
Very likely because `chromedriver` runs inside the `maven:3.9.1` image, which doesn't have the required dependencies. So you need to install them, or can use an image that has both mvn/chromedriver - you could try this one for instance: https://hub.docker.com/r/markhobson/maven-chrome/Similar issue here -> https://community.atlassian.com/t5/Bitbucket-questions/How-to-get-chromedriver-working-in-pipelines/qaq-p/1290531
Hello!
First of all, thank you for commenting and sorry for taking so long to reply... I am still stuck on this.
I have created my own image Docker with Maven 3.9.1, Java 17, ChromeDriver 120 and Chrome 120. In my local, everthing works fine but in pipeline not. I think is due to execute Chrome inside a container. Here is my Dockerfile:
# Utiliza la imagen base de UbuntuFROM ubuntu:latest# Actualiza los repositorios e instala herramientas básicasRUN apt-get update && \apt-get install -y wget unzip gnupg xvfb dbus-x11# Descarga e instala el navegador ChromeRUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/google-chrome-archive-keyring.gpg && \echo 'deb [signed-by=/usr/share/keyrings/google-chrome-archive-keyring.gpg arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google-chrome.list && \apt-get update && \apt-get install -y google-chrome-stable#ChromedriverRUN wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6045.159/linux64/chromedriver-linux64.zip -P /tmp && \unzip /tmp/chromedriver-linux64.zip -d /usr/local/bin && \rm /tmp/chromedriver-linux64.zip#Mover ChromediverRUN mkdir -p /root/.m2/repository/webdriver/chromedriver/linux64/114.0.5735.90/ && \mv /usr/local/bin/chromedriver-linux64/* /root/.m2/repository/webdriver/chromedriver/linux64/114.0.5735.90/# Descarga e instala OpenJDK 17RUN apt-get install -y openjdk-17-jdk# Descarga e instala Maven 3.9.1RUN wget https://archive.apache.org/dist/maven/maven-3/3.9.1/binaries/apache-maven-3.9.1-bin.tar.gz -P /tmp && \tar xf /tmp/apache-maven-3.9.1-bin.tar.gz -C /opt && \ln -s /opt/apache-maven-3.9.1 /opt/maven && \ln -s /opt/maven/bin/mvn /usr/local/bin/mvn && \rm /tmp/apache-maven-3.9.1-bin.tar.gz# Establece las variables de entorno para Maven y JavaENV MAVEN_HOME /opt/mavenENV MAVEN_CONFIG /root/.m2ENV PATH "$PATH:/opt/maven/bin"ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64ENV PATH "$PATH:$JAVA_HOME/bin"ENV DISPLAY=:99RUN Xvfb :99 -screen 0 1920x1080x24 -ac > /dev/null 2>&1 &
Here is my pipeline:
image: carmeneoris/selenium-maven:seleniumpipelines: default: - step: name: Execute tests trigger: automatic script: - mvn clean install -X '-Dspring.profiles.active=${environmentName}' -DsuiteFileName=$testSuite -Dthreads=$threadsCount
And here is the error when pipeline executes the command mvn clean install...:
Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.<br>(session not created: DevToolsActivePort file doesn't exist)<br>(The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) <span>org.openqa.selenium.SessionNotCreatedException: </span>
Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.<br>
(session not created: DevToolsActivePort file doesn't exist)<br>
(The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
It looks like you're new here. Sign in or register to get started.