Cant start browser on docker image


I have created a new image dockerfile but i have some issue to start my test on drivers
Could you please provide solution
Thank you

Use the official Ubuntu as the base image

FROM ubuntu:latest

Set environment variables to avoid interactive prompts during installation

ENV DEBIAN_FRONTEND=noninteractive

Install necessary dependencies, including wget

RUN apt-get update && apt-get install -y
&& apt-get clean
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update -qq && apt-get install -y -qq
wget \

Additional packages

&& apt-get clean
&& rm -rf /var/lib/apt/lists/*

Edge Installation

RUN wget -q -O- | apt-key add -
RUN add-apt-repository “deb [arch=amd64] Index of /repos/edge/ stable main”
RUN apt install -y microsoft-edge-stable
RUN microsoft-edge --version
RUN which microsoft-edge

Download and install Microsoft Edge WebDriver

RUN wget -q
&& unzip -q
&& chmod +x msedgedriver
&& mv msedgedriver /usr/local/bin

Verify msedgedriver installation

RUN msedgedriver --version

Upgrade pip and install required Python packages

RUN pip3 install --upgrade pip &&
pip3 install

ENV PATH=$PATH:/usr/local/bin:/usr/bin/microsoft-edge:/usr/local/bin/msedgedriver

Install Chrome and Geckodriver

RUN wget -q -O - | apt-key add -
&& echo “deb [arch=amd64] stable main” >> /etc/apt/sources.list.d/google-chrome.list
&& apt-get update
&& apt-get install -f -y google-chrome-stable
xvfb \

&& wget -q -O /tmp/geckodriver.tar.gz
&& tar -C /usr/local/bin -xzf /tmp/geckodriver.tar.gz
&& chmod 0755 /usr/local/bin
&& cd /usr/local/bin
&& ls
&& rm /tmp/geckodriver.tar.gz
&& cd /tmp \

&& wget
&& unzip
&& rm -rf
&& mv -f chromedriver /usr/local/bin/chromedriver
&& chmod 0755 /usr/local/bin/chromedriver
&& apt-get clean
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /usr/share/doc

Clean up

RUN apt-get clean &&
rm -rf /var/lib/apt/lists/*

running test with edge gives

SessionNotCreatedException: Message: session not created: Microsoft Edge failed to start: exited normally.

105 (session not created: DevToolsActivePort file doesn’t exist)

106 (The process started from msedge location /usr/bin/google-chrome is no longer running, so msedgedriver is assuming that msedge has crashed.)

running test with chrome gives

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114

110Current browser version is 118.0.5993.117 with binary path /usr/bin/google-chrome

running test with gecko gives

WebDriverException: Message: Process unexpectedly closed with status 1

These are fairly old versions. Not sure how SeleniumLibrary v5.1.3 will handle the latest version of Edge. Any reasons for keeping these older versions?

I will use the latest version
And maybe need to update the full test repository then
Could you share a working script to run edge browser in case my existing keyword is not working

I will update you

Hi @Ultra,

I don’t see a Display? The browsers (Chrome and Firefox for sure, Edge probably) need a display even when running headless.

A simple way to deal with this docker containers, VM’s, etc is install XVFB, then configure the port it runs on, and use that same port number when configuring your DISPLAY variable.

Hope that helps,