image: maven:3.9.1
pipelines:
default:
name: Execute tests
trigger: automatic
caches:
- maven
script:
- mvn clean install '-Dspring.profiles.active=${environmentName}' -DsuiteFileName=$testSuite -Dthreads=$threadsCount
services:
- selenium-chrome
definitions:
services:
selenium-chrome:
image: selenium/standalone-chrome:3.141.59-oxygen
/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
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 Ubuntu
FROM ubuntu:latest
# Actualiza los repositorios e instala herramientas básicas
RUN apt-get update && \
apt-get install -y wget unzip gnupg xvfb dbus-x11
# Descarga e instala el navegador Chrome
RUN 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
#Chromedriver
RUN 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 Chromediver
RUN 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 17
RUN apt-get install -y openjdk-17-jdk
# Descarga e instala Maven 3.9.1
RUN 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 Java
ENV MAVEN_HOME /opt/maven
ENV MAVEN_CONFIG /root/.m2
ENV PATH "$PATH:/opt/maven/bin"
ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64
ENV PATH "$PATH:$JAVA_HOME/bin"
ENV DISPLAY=:99
RUN Xvfb :99 -screen 0 1920x1080x24 -ac > /dev/null 2>&1 &
Here is my pipeline:
image: carmeneoris/selenium-maven:selenium
pipelines:
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...:
org.openqa.selenium.SessionNotCreatedException:
Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
(session not created: DevToolsActivePort file doesn't exist)
(The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.