Public Repository

Last pushed: 2 years ago
Short Description
Selenium Server with Xvfb, Firefox and Chromium
Full Description

This is a Docker Image with Selenium Server, Xvfb, Firefox and Chromium installed. SeleniumEnv was created to run Selenium tests without installing Selenium and its dependencies. Selenium server is executed inside a container and connected from a host machine.

Installation

Grab prepacked image from a Docker Hub

docker pull davert/selenium-env

Or build image by yourself. Just clone this repo and run

docker build -t selenium-env .

you should edit Dockerfile in order to customize version of Selenium Server.

Usage

SeleniumEnv is able to connect to local or remote web sites.

Accessing Remote Website

Run the container and bind it to default Selenium port 4444

docker run -i -t -p 4444:4444 davert/selenium-env

Accessing Local Website by Port

In case you want to access local website from container you can do the following:
if application is run on localhost (0.0.0.0) on a specific port, you can pass APP_PORT environment variable into it:

php -S 0.0.0.0:8000 & 
docker run -i -t -p 4444:4444 -e APP_PORT=8000 davert/selenium-env

Accessing Local Website by Host

In case local web site is served by nginx or Apache, and is configured for a specific host, you can pass host name as environment variable:

docker run -i -t -p 4444:4444 -e APP_HOST=myapp davert/selenium-env
Docker Pull Command
Owner
davert

Comments (1)
shabster
3 years ago

hi my SeleniumEnv docker not working

i did the following :

@docker

docker@boot2docker:~$ docker run -i -t -p 4444:4444 -e APP_HOST=http://192.168.59.103:8080 davert/selenium-env

Running Selenium Env: Selenium Server, and Xvfb with Firefox and Chromium Host IP: 172.17.42.1 Registering host http://192.168.59.103:8080 [dix] Could not init font path element /usr/share/fonts/X11/cyrillic, removing from list! [dix] Could not init font path element /usr/share/fonts/X11/100dpi/:unscaled, removing from list! [dix] Could not init font path element /usr/share/fonts/X11/75dpi/:unscaled, removing from list! [dix] Could not init font path element /usr/share/fonts/X11/Type1, removing from list! [dix] Could not init font path element /usr/share/fonts/X11/100dpi, removing from list! [dix] Could not init font path element /usr/share/fonts/X11/75dpi, removing from list! [dix] Could not init font path element /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType, removing from list! 20:18:31.889 INFO - Launching a standalone server 20:18:32.162 INFO - Java: Oracle Corporation 24.60-b09 20:18:32.162 INFO - OS: Linux 3.18.5-tinycore64 amd64 20:18:32.248 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf 20:18:32.592 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: LINUX 20:18:32.972 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub 20:18:32.974 INFO - Version Jetty/5.1.x 20:18:32.976 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver] 20:18:32.978 INFO - Started HttpContext[/selenium-server,/selenium-server] 20:18:32.978 INFO - Started HttpContext[/,/] 20:18:33.144 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@1a966bcb 20:18:33.144 INFO - Started HttpContext[/wd,/wd] 20:18:33.167 INFO - Started SocketListener on 0.0.0.0:4444 20:18:33.167 INFO - Started org.openqa.jetty.jetty.Server@2b6ea258

then tried to run the codeception tests i get following error:

[WebDriverCurlException] Curl error thrown for http POST to /session with params: {"desiredCapabilit ies":{"browserName":"firefox"}} Failed to connect to 127.0.0.1 port 4444: Connection refused

please help !