I need to launch geckodriver for a remote auto-testing in firefox. I created a Dockerfile in which I install firefox and geckodriver compatible with one. In this case I use:
- Firefox: 120.0
- Geckodriver: 0.34.0
What is the problem? When I'm trying to create a session, it is created with 200 response code, but on a server side I see the error in console from geckodriver like:
console.error: (new Error("Unexpected content-type \"text/plain;charset=US-ASCII\"", "resource://services-settings/Utils.sys.mjs", 399))
I can't understand how to sort out this issue. All shared libraries and dependencies are installed. Firefox and Geckodriver is installed like:
RUN apt-get update -qqy && \
apt-get -qqy --no-install-recommends install firefox && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/* && \
wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/$VERSION/linux-x86_64/en-US/firefox-$VERSION.tar.bz2 && \
apt-get -y purge firefox && \
rm -rf /opt/firefox && \
tar -C /opt -xjf /tmp/firefox.tar.bz2 && \
rm /tmp/firefox.tar.bz2 && \
mv /opt/firefox /opt/firefox-$VERSION && \
ln -fs /opt/firefox-$VERSION/firefox /usr/bin/firefox
RUN GECKODRIVER_VERSION=$(/driver/geckoCompability $VERSION) && \
wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz && \
rm -rf /opt/geckodriver && \
tar -C /opt -zxf /tmp/geckodriver.tar.gz && \
rm /tmp/geckodriver.tar.gz && \
mv /opt/geckodriver /opt/geckodriver-$GECKODRIVER_VERSION && \
chmod 755 /opt/geckodriver-$GECKODRIVER_VERSION && \
ln -fs /opt/geckodriver-$GECKODRIVER_VERSION /usr/bin/geckodriver/geckodriver
The request looks like:
curl -H 'Content-Type: application/json' --data '{"capabilities": {"alwaysMatch": {"acceptInsecureCerts": true}}}' http://127.0.0.1:4444/session
Geckodriver is running by a command:
DISPLAY=$DISPLAY MOZ_REMOTE_SETTINGS_DEVTOOLS=1 /usr/bin/geckodriver/geckodriver --host 0.0.0.0 --allow-origins 'http://127.0.0.1:4444' --allow-hosts='*' & DRIVER_PID=$!