diff --git a/NodeBase/Dockerfile.txt b/NodeBase/Dockerfile.txt index f4f7763747..48b5efa058 100644 --- a/NodeBase/Dockerfile.txt +++ b/NodeBase/Dockerfile.txt @@ -88,6 +88,7 @@ COPY selenium.conf /etc/supervisor/conf.d/ ENV SCREEN_WIDTH 1360 ENV SCREEN_HEIGHT 1020 ENV SCREEN_DEPTH 24 +ENV SCREEN_DPI 96 ENV DISPLAY :99.0 ENV START_XVFB true diff --git a/NodeBase/start-xvfb.sh b/NodeBase/start-xvfb.sh index ed0fe9ef6d..4d2ed0f2ce 100755 --- a/NodeBase/start-xvfb.sh +++ b/NodeBase/start-xvfb.sh @@ -5,7 +5,7 @@ if [ "${START_XVFB}" = true ] ; then rm -f /tmp/.X*lock - /usr/bin/Xvfb ${DISPLAY} -screen 0 ${GEOMETRY} -ac +extension RANDR + /usr/bin/Xvfb ${DISPLAY} -screen 0 ${GEOMETRY} -dpi ${SCREEN_DPI} -ac +extension RANDR else echo "Xvfb won't start. Chrome/Firefox can only run in headless mode. Remember to set the 'headless' flag in your test." fi diff --git a/README.md b/README.md index 957e086cc5..30d11606e6 100644 --- a/README.md +++ b/README.md @@ -253,10 +253,10 @@ $ docker run -d -p :5555 -e HUB_HOST= -e HUB_PORT=44 ### Setting Screen Resolution -By default, nodes start with a screen resolution of 1360 x 1020 with a color depth of 24 bits. These settings can be adjusted by specifying `SCREEN_WIDTH`, `SCREEN_HEIGHT` and/or `SCREEN_DEPTH` environmental variables when starting the container. +By default, nodes start with a screen resolution of 1360 x 1020 with a color depth of 24 bits and a dpi of 96. These settings can be adjusted by specifying `SCREEN_WIDTH`, `SCREEN_HEIGHT`, `SCREEN_DEPTH`, and/or `SCREEN_DPI` environmental variables when starting the container. ``` bash -docker run -d -e SCREEN_WIDTH=1366 -e SCREEN_HEIGHT=768 -e SCREEN_DEPTH=24 selenium/standalone-firefox +docker run -d -e SCREEN_WIDTH=1366 -e SCREEN_HEIGHT=768 -e SCREEN_DEPTH=24 -e SCREEN_DPI=74 selenium/standalone-firefox ``` Bear in mind that in non-debug images, the maximize window command won't work. You can use the resize window command