The “DevToolsActivePort file doesn’t exist” error in Katalon Studio/Docker typically occurs due to Chrome startup issues in headless mode.
1. Update Chrome Arguments
Modify your -webui.chrome.args
to include mandatory flags for Docker:
bash
-webui.chrome.args="--no-sandbox;--disable-dev-shm-usage;--disable-gpu;--headless=new;--remote-debugging-port=9222;--remote-allow-origins=*;--disable-setuid-sandbox"
- Key Fixes:
- Add
--remote-allow-origins=*
to bypass Chrome 111+ security policies.
- Use
--disable-setuid-sandbox
for Docker environments.
2. Verify Chrome & ChromeDriver Versions
Ensure compatibility between Chrome and ChromeDriver in the Docker image:
bash
# Add this to your Dockerfile
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
apt install -y ./google-chrome-stable_current_amd64.deb && \
CHROME_VERSION=$(google-chrome --version | awk '{print $3}') && \
CHROMEDRIVER_VERSION=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION%.*}) && \
wget -q https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip && \
unzip chromedriver_linux64.zip -d /usr/local/bin/
3. Configure Desired Capabilities
In your Katalon project’s Drivers/Chrome/Drivers
folder:
- Create/update
chrome-headless.properties
:
headless=true
args=--no-sandbox,--disable-dev-shm-usage,--disable-gpu,--headless=new,--remote-debugging-port=9222,--remote-allow-origins=*
4. Update Katalon Image & Dependencies
Use a newer Katalon image with required dependencies:
FROM katalonstudio/katalon:10.2.0
RUN apt-get update && apt-get install -y \
libgbm-dev \
xvfb \
&& rm -rf /var/lib/apt/lists/*
5. Full Pipeline Command
bash
katalonc.sh -runMode=console \
-projectPath=$CURRENT_DIR/my-app.prj \
-retry=0 \
-statusDelay=15 \
-testSuitePath="Test Suites/Smoke/Smoke" \
-browserType="Chrome" \ # Use "Chrome" instead of mobile device
-executionProfile="XXX" \
-apiKey=XXX \
--config \
-proxy.auth.option=NO_PROXY \
-proxy.system.option=NO_PROXY \
-proxy.system.applyToDesiredCapabilities=true \
-webui.chrome.args="--no-sandbox;--disable-dev-shm-usage;--disable-gpu;--headless=new;--remote-debugging-port=9222;--remote-allow-origins=*"
6. Environment Variables
Add these to your Docker run command:
bash
-e DBUS_SESSION_BUS_ADDRESS=/dev/null \
-e DISPLAY=:99 \
Why This Works:
--remote-allow-origins=*
: Fixes Chrome 111+ security restrictions.
- Updated Image: Katalon 10.2.0 has better headless support.
- Dependencies:
libgbm-dev
and xvfb
resolve graphics stack issues.
- Simplified Browser: Using “Chrome” instead of mobile emulation avoids conflicts.
Verify Fix:
Run a minimal test case in your pipeline:
groovy
// Verify Chrome launches
WebUI.openBrowser('')
WebUI.navigateToUrl('https://katalon.com')
WebUI.closeBrowser()