GithubHelp home page GithubHelp logo

seleniumhq / docker-selenium Goto Github PK

View Code? Open in Web Editor NEW
7.8K 253.0 2.5K 3.76 MB

Provides a simple way to run Selenium Grid with Chrome, Firefox, and Edge using Docker, making it easier to perform browser automation

Home Page: http://www.selenium.dev/docker-selenium/

License: Other

Shell 49.89% Makefile 14.17% Python 13.00% Dockerfile 10.21% Smarty 12.73%
selenium selenium-grid selenium-node selenium-server webdriver docker docker-selenium kubernetes-selenium kubernetes

docker-selenium's People

Contributors

abaldwin-op avatar alexgibson avatar amardeep2006 avatar chenrui333 avatar ddavison avatar dependabot[bot] avatar diemol avatar doofus100500 avatar elgalu avatar garagepoort avatar jamesmortensen avatar jeff-jk avatar jsa34 avatar kayabendroth avatar luisfcorreia avatar maccracken avatar manoj9788 avatar marten-cz avatar metajiji avatar mtcolman avatar mtscout6 avatar niqo avatar pablofuente avatar renovate[bot] avatar selenium-ci avatar testphreak avatar tnguyen14 avatar vietnd96 avatar willabides avatar zainabsalameh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-selenium's Issues

Can't set timezone in container

We're running into timezone issues because the docker-selenium containers have a different timezone than our host has. This is mostly due to this line in the Dockerfile:

ENV TZ "US/Pacific"

We can fix /etc/timezone and /etc/localtime by running the container with: -v /etc/timezone:/etc/timezone:ro -v /etc/localtime:/etc/localtime:r, but that doesn't allow us to overwrite the TZ env var. This results in tools like date and Firefox still using the US/Pacific timezone.

How to use this?

How exactly do I get this running correctly on OSX? I have boot2docker installed and when I run docker pull or docker run, sometimes it starts up, sometimes I get a certificate error (which I have to wipe all and restart docker).

I also get this error sometimes:

An error occurred trying to connect: Post https://192.168.59.103:2376/v1.19/containers/create: dial tcp 192.168.59.103:2376: i/o timeout

So when I do get the docker image running, attempts to connect to it over VNC fail.

Improve docker stop support

Currently when you run docker stop <container-id|container-name> the container does not shutdown gracefully.

Setting up VNC fails

When trying to use the 'standalone-chrome-debug' image I cannot connect to the vnc port.

In the logs I see:
09/07/2015 01:59:50 passing arg to libvncserver: -rfbport
09/07/2015 01:59:50 passing arg to libvncserver: 5900
Enter VNC password: stty: standard input: Inappropriate ioctl for device
fgets: No such file or directory
stty: standard input: Inappropriate ioctl for device
x11vnc -usepw: could not find a password to use.
Failed to read: session.ignoreBorder

It seems that vnc tries to 'obfuscate' the password that is entered in the tty, but that is not possible in stty.

FireFox Native Events

I can't seem to enable native events when using Firefox Standalone. I've tried by creating a FireFox profile on the remote end and within the container, but I can't seem to get it to work. How does one go about doing this?

Start vnc with docker exec instead of having separate debug images

Instead of having separate debug images, we could use the main images for debugging after running a docker exec command to start a vnc service. I've created willroden/se-chrome-standalone-plus as a proof-of-concept that extends standalone-chrome and adds start_vnc.sh and x11vnc to allow you to enable vnc through docker exec $CONTAINER /opt/bin/start_vnc.sh

This has two main benefits:

  1. Reduces the number of images to maintain
  2. Complies with the requirement to not have multiple processes running by default on any images (because the extra vnc process only runs with intervention)

The only drawback I can think of is adding to the size of the default images. IMO, this is a small increase, but should be considered nonetheless.

selenium/hub, selenium/node-firefox, selenium/node-chrome won't start

I'm running a brand-new install of openSUSE 13.2. When I attempt to run selenium-hub containers, they exit with exit status 1. There is no log output.

I've tried both 2.44 and 2.45 versions, and I've even tried running bash:

me@me:~/mydir> docker run -d -p 4444:4444 --name selenium-hub selenium/hub:2.45.0
e6631b834889a412f64bedb0ab4ed40ce42059c7c26d3b347575c3a2353b344e
FATA[0000] Error response from daemon: Cannot start container e6631b834889a412f64bedb0ab4ed40ce42059c7c26d3b347575c3a2353b344e:  (exit status 1)
me@me:~/mydir> docker run -it -p 4444:4444 --name selenium-hub selenium/hub:2.45.0 bash
FATA[0000] Error response from daemon: Cannot start container 25bd245240f7952b3870c3c3e32d07eb1f71dd8a75fd5b2f8d74e3e1260a3cea:  (exit status 1)

Investigate X11 forwarding as opposed to VNC

Initial issue derived from elgalu/docker-selenium#10

According to the Docker Official Repo Guidelines These images should not derive from phusion/baseimage. However, the initial reason to base off that image was to provide stability when running a Selenium node with VNC and Xvfb support.

There was an IRC conversation with @psftw regarding a possible means of utilizing a separate container for debug purposes using X11 forwarding. This approach would remove the need to support VNC in the same container as the Selenium node, thus getting us one step closer to a more efficient image.

I have done some initial work on this on my personal x11 branch which is still a ROUGH DRAFT. In there I was able to achieve using Xvfb and the Selenium node in a single process tree. The next goal is to figure out how to attach another container and perform an SSH connection with X11 forwarding.

Firefox node issue, browser hangs

Hello,

my firefox nodes (i am running docker on ubuntu server) seem to hang (100% reproduces), as using custom docker builds as using official via docker pull (chrome nodes work well).

I tried to execute firefox in the container, seems to be no display configured:

#docker run c6970094431e /usr/bin/firefox

(process:1): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Error: cannot open display: :99.0

If i execute docker logs $CID i see the following:

18:47:35.677 INFO - Executing: [new session: Capabilities [{platform=ANY, javascriptEnabled=true, browserName=firefox, version=}]])
18:47:35.678 INFO - Creating a new session for Capabilities [{platform=ANY, javascriptEnabled=true, browserName=firefox, version=}]
18:48:20.901 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: 'c9657e29a60a', ip: '172.17.0.34', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-32-generic', java.version: '1.7.0_65'
Driver info: driver.version: unknown
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:188)
        at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:175)
        at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:111)
        at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:88)
        at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:108)
        at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:57)
        at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1)
        at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:112)
        at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:172)
        at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:201)
        at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:163)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:129)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
        at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
        at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
        at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
        at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
        at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
        at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
        at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
        at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
        at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: 'c9657e29a60a', ip: '172.17.0.34', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-32-generic', java.version: '1.7.0_65'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:69)
        at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:53)
        at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:54)
        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:214)
        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:168)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:59)
        ... 9 more
Caused by: org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows:

(process:734): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Xlib:  extension "RANDR" missing on display ":99".
process 734: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/etc/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.

Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: 'c9657e29a60a', ip: '172.17.0.34', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-32-generic', java.version: '1.7.0_65'
Driver info: driver.version: FirefoxDriver
        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:134)
        at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:104)
        ... 14 more
Caused by: org.openqa.selenium.WebDriverException: java.lang.InterruptedException: Process timed out after waiting for 45000 ms.
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: 'c9657e29a60a', ip: '172.17.0.34', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-32-generic', java.version: '1.7.0_65'
Driver info: driver.version: FirefoxDriver
        at org.openqa.selenium.os.CommandLine.waitFor(CommandLine.java:131)
        at org.openqa.selenium.firefox.FirefoxBinary.waitFor(FirefoxBinary.java:222)
        at org.openqa.selenium.firefox.FirefoxBinary.clean(FirefoxBinary.java:242)
        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:91)
        ... 19 more
Caused by: java.lang.InterruptedException: Process timed out after waiting for 45000 ms.
        at org.openqa.selenium.os.UnixProcess.waitFor(UnixProcess.java:148)
        at org.openqa.selenium.os.CommandLine.waitFor(CommandLine.java:129)
        ... 22 more
18:48:20.904 WARN - Exception: Process timed out after waiting for 45000 ms.

" Failed to read: session.screen0.*" on firefox debug node startup

Hi,

I was trying to setup selenium grid with fig and docker on Mac OS. But on a startup every node was complaining about same problems :

node2_1 | 16:10:34.265 INFO - Starting auto register thread. Will try to register every 5000 ms.
node2_1 | 16:10:34.265 INFO - Registering the node to hub :http://172.17.0.7:4444/grid/register
node2_1 | Failed to read: session.screen0.opaqueMove
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.fullMaximization
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.maxIgnoreIncrement
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.maxDisableMove
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.maxDisableResize
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.workspacewarping
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.showwindowposition
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.autoRaise
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.clickRaises
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.defaultDeco
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tab.placement
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.windowMenu
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.noFocusWhileTypingDelay
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.workspaces
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.edgeSnapThreshold
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.window.focus.alpha
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.window.unfocus.alpha
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.menu.alpha
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.menuDelay
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tab.width
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tooltipDelay
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.allowRemoteActions
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.clientMenu.usePixmap
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tabs.usePixmap
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tabs.maxOver
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tabs.intitlebar
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.focusModel
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tabFocusModel
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.focusNewWindows
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.focusSameHead
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.rowPlacementDirection
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.colPlacementDirection
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.windowPlacement
node2_1 | Setting default value
node2_1 | Xlib:  extension "RANDR" missing on display ":99.0".
node2_1 | Failed to read: session.ignoreBorder
node2_1 | Setting default value
node2_1 | Failed to read: session.forcePseudoTransparency
node2_1 | Setting default value
node2_1 | Failed to read: session.colorsPerChannel
node2_1 | Setting default value
node2_1 | Failed to read: session.doubleClickInterval
node2_1 | Setting default value
node2_1 | Failed to read: session.tabPadding
node2_1 | Setting default value
node2_1 | Failed to read: session.styleOverlay
node2_1 | Setting default value
node2_1 | Failed to read: session.slitlistFile
node2_1 | Setting default value
node2_1 | Failed to read: session.appsFile
node2_1 | Setting default value
node2_1 | Failed to read: session.tabsAttachArea
node2_1 | Setting default value
node2_1 | Failed to read: session.cacheLife
node2_1 | Setting default value
node2_1 | Failed to read: session.cacheMax
node2_1 | Setting default value
node2_1 | Failed to read: session.autoRaiseDelay
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.opaqueMove
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.fullMaximization
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.maxIgnoreIncrement
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.maxDisableMove
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.maxDisableResize
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.workspacewarping
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.showwindowposition
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.autoRaise
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.clickRaises
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.defaultDeco
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tab.placement
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.windowMenu
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.noFocusWhileTypingDelay
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.workspaces
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.edgeSnapThreshold
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.window.focus.alpha
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.window.unfocus.alpha
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.menu.alpha
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.menuDelay
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tab.width
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tooltipDelay
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.allowRemoteActions
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.clientMenu.usePixmap
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tabs.usePixmap
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tabs.maxOver
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tabs.intitlebar
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.focusModel
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.tabFocusModel
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.focusNewWindows
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.focusSameHead
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.rowPlacementDirection
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.colPlacementDirection
node2_1 | Setting default value
node2_1 | Failed to read: session.screen0.windowPlacement
node2_1 | Setting default value
node2_1 | 29/01/2015 16:10:34
node2_1 | 29/01/2015 16:10:34 Scroll Detection: -scrollcopyrect mode is in effect to
node2_1 | 29/01/2015 16:10:34   use RECORD extension to try to detect scrolling windows
node2_1 | 29/01/2015 16:10:34   (induced by either user keystroke or mouse input).
node2_1 | 29/01/2015 16:10:34   If this yields undesired behavior (poor response, painting
node2_1 | 29/01/2015 16:10:34   errors, etc) it may be disabled via: '-noscr'
node2_1 | 29/01/2015 16:10:34   Also see the -help entry for tuning parameters.
node2_1 | 29/01/2015 16:10:34   You can press 3 Alt_L's (Left "Alt" key) in a row to
node2_1 | 29/01/2015 16:10:34   repaint the screen, also see the -fixscreen option for
node2_1 | 29/01/2015 16:10:34   periodic repaints.
node2_1 | 29/01/2015 16:10:34
node2_1 | 29/01/2015 16:10:34 XKEYBOARD: number of keysyms per keycode 7 is greater
node2_1 | 29/01/2015 16:10:34   than 4 and 51 keysyms are mapped above 4.
node2_1 | 29/01/2015 16:10:34   Automatically switching to -xkb mode.
node2_1 | 29/01/2015 16:10:34   If this makes the key mapping worse you can
node2_1 | 29/01/2015 16:10:34   disable it with the "-noxkb" option.
node2_1 | 29/01/2015 16:10:34   Also, remember "-remap DEAD" for accenting characters.
node2_1 | 29/01/2015 16:10:34
node2_1 | 29/01/2015 16:10:34 X FBPM extension not supported.
node2_1 | 29/01/2015 16:10:34 X display is not capable of DPMS.
node2_1 | 29/01/2015 16:10:34 --------------------------------------------------------
node2_1 | 29/01/2015 16:10:34
node2_1 | 29/01/2015 16:10:34 Default visual ID: 0x21
node2_1 | 29/01/2015 16:10:34 Read initial data from X display into framebuffer.
node2_1 | 29/01/2015 16:10:34 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/5440
node2_1 | 29/01/2015 16:10:34
node2_1 | 29/01/2015 16:10:34 X display :99.0 is 32bpp depth=24 true color
node2_1 | 29/01/2015 16:10:34
node2_1 | 29/01/2015 16:10:34 Listening for VNC connections on TCP port 5900
node2_1 | 29/01/2015 16:10:34 Listening for VNC connections on TCP6 port 5900
node2_1 | 29/01/2015 16:10:34 listen6: bind: Address already in use
node2_1 | 29/01/2015 16:10:34 Not listening on IPv6 interface.
node2_1 | 29/01/2015 16:10:34 fb read rate: 1306 MB/sec
node2_1 | 29/01/2015 16:10:34 fast read: reset -wait  ms to: 10
node2_1 | 29/01/2015 16:10:34 fast read: reset -defer ms to: 10
node2_1 | 29/01/2015 16:10:34 The X server says there are 10 mouse buttons.
node2_1 | 29/01/2015 16:10:34 screen setup finished.
node2_1 | 29/01/2015 16:10:34
node2_1 |
node2_1 | The VNC desktop is:      a8225954779d:0

What this all complains mean and how could i connect to it through vnc? I tried all possible solutions, but it doesn't work for me.
In my bashrc file i have

export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH=/Users/biercoff/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1

and i tried to run

vncviewer 192.168.59.103:49155

but ended up with an error. I also tried to access to vnc of each node, but with no success :

docker inspect $(docker ps -q) | grep IPA
"IPAddress": "172.17.0.13",
        "IPAddress": "172.17.0.11",
        "IPAddress": "172.17.0.9",
        "IPAddress": "172.17.0.7",
vncviewer 172.17.0.11:49155

And as a result - an error. What am i'm doing wrong ?

Thanks in advance

Nodes require docker --link

The NodeBase/entry_point.sh checks for the environment variable $HUB_PORT_4444_TCP_ADDR, but executes selenium server hardcoded with http://hub:4444/

This makes it hard to run the images in any orchestrating frameworks, as most of them does not manipulate the hosts on the containers (or use dockers link feature).

Set log level to WARN?

In the readme it mentions all output is directed to stdout, however the log level appears to be INFO or lower.

I searched the repo and the only line referencing log level appears to be this one:

--enable-logging=stderr --log-level=0

Is modifying this shell script the only way to set a higher log level of, say, WARN? And is it possible to do that without forking this repo, changing that line, and then using my changed version? (My gut instinct is that there must be a more elegant way -- unless this feature has yet to be implemented)

Thanks in advance if anyone can answer this question; I appreciate all the great work you guys are doing here.

run 2 or more containers on the save server with unique ports

By default node starts on port 5555 and you can only run on container per machine.

If you want to run more than one you have to specify -port 5556 for example.

We are managing our containers with docker::run and currently there is no way to start a more than one container per server becuase only one service can run on port 5555.

TODO: create PR where NODE can be given HOST and PORT to be accessible from the outside world.

Current solution of having REMOTE_HOST only addresses the part about the HOST but not PORT which by default is always 5555.

Example of puppet code:


docker::run { 'selenium-node-1':
      image           => "$image",
      env             => ["NODE_HOST=$fqdn", "NODE_PORT=5558", "HUB_PORT_4444_TCP_ADDR=$hub_addr", "HUB_PORT_4444_TCP_PORT=$hub_port"],
      ports           => ['5558:5558'],
      pull_on_start   => true
    }

docker::run { 'selenium-node-2':
      image           => "$image",
      env             => ["NODE_HOST=$fqdn", "NODE_PORT=5559", "HUB_PORT_4444_TCP_ADDR=$hub_addr", "HUB_PORT_4444_TCP_PORT=$hub_port"],
      ports           => ['5559:5559'],
      pull_on_start   => true
    }

the above puppet manifest snippet for selenium-node-2 is equivalent to running docker as:

docker run -d -p 5559:5559 -e NODE_ADDR="$(facter -p fqdn)" -e NODE_PORT="5559" -e HUB_PORT_4444_TCP_ADDR="foo" -e HUB_PORT_4444_TCP_PORT="4444" selenium/node-firefox

I could run it as following

docker run -d -p 5556:5555 -e REMOTE_HOST="http://$(facter -p fqdn):5556" -e HUB_PORT_4444_TCP_ADDR="foo" -e HUB_PORT_4444_TCP_PORT="4444" selenium/node-firefox

but once I run this I can't start a new container on 5555 since that port is already used.

We can offload all the configuratoion of node to the json file like we do with hub but I think I should be able to configure how the container is being executed and on port outside of the json config of the node itself.

Food for thought?

Cannot open browser in Docker container

Observed result:

Cannot connect to virtual display

07:39:51.778 INFO - Executing: [new session: Capabilities [{platform=ANY, browserName=firefox, version=}]])
07:39:51.780 INFO - Creating a new session for Capabilities [{platform=ANY, browserName=firefox, version=}]
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
(process:87): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Error: cannot open display: :99.0
(process:95): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Error: cannot open display: :99.0
        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
        at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)

Expected result:

  • browser is started,

Steps to reproduce:

  • start docker-selenium hub
  • start docker-selenium node
docker run -i -t --cap-add=NET_ADMIN -p 5555:5555 selenium/node-firefox /bin/bash

java -jar ./opt/selenium/selenium-server-standalone.jar -role wd -hub http://<hostname>:4444/grid/register -browser browserName="firefox",maxInstances=1

Environment

  • CentOS
  • selenium 2.45.0
  • selenium/hub
  • selenium/node-chrome
  • selenium/node-firefox
  • docker-selenium firefox node as well as chrome

Workaround

docker run -i -t --cap-add=NET_ADMIN -p 5555:5555 selenium/node-firefox /bin/bash
Xvfb :1 -screen 0 1024x768x16 &
export DISPLAY=:1
java -jar ./opt/selenium/selenium-server-standalone.jar -role wd -hub http://<hostname>:4444/grid/register -browser browserName="firefox",maxInstances=1

official docker hub build process

I think we need to solve the problem of automated build on docker hub.

Our 11 images need to be built in ordered sequence (see Makefile):

  • base
  • hub, node-base
  • node-firefox, node-chrome
  • node-firefox-debug, node-chrome-debug
  • standalone-firefox, standalone-chrome
  • standalone-firefox-debug, standalone-chrome-debug

Problem: currently each Docker repo has an Automated Build active which creates race conditions when new commits trigger builds.

In order to create an ordered chain we can turn off deactivate Automated Build and:

  • build manually with the established sequence
  • or enable each build with trigger via curl in correct sequence

Thoughts? opinions?

AFAIK I dont't think docker hub provides build chains: https://docs.docker.com/v1.1/docker-hub/builds/

I like how CircleCI runs our build in sequence using make build defined in circle.yml but not docker hub.

I am now tempted to go with deactivating automated build and doing image release manually to avoid those race conditions.

Unable to set -remoteHost parameter for nodes without using custom config.json

Hi,

I've got this setup on separate hosts. So one host runs the HUB, and then several other hosts have nodes running on them. In this use case, I am unable to link containers, so I need to expose ports, and public IPs of hosts running nodes in order to connect to the HUB. Below is the example command that we use to start a node (replace 1.2.3.4 with IP of hub):

docker run -d -p 5555:5555 -e HUB_PORT_4444_TCP_ADDR="1.2.3.4" -e HUB_PORT_4444_TCP_PORT="4444" --name firefox-node selenium/node-firefox

What ends up happening, is the value for remoteHost gets set to the 'private' IP of the docker container itself. If you exec into a running docker container, and execute ipconfig, you'll see the IP that it uses. This is fine if you are 'linked' to the hub, but when running on separate hosts, the hub cannot contact the private IP. To enable this to work, we need support for -remoteHost parameter when starting the nodes.

-remoteHost is a built in parameter for selenium. More info available here: http://automatictester.co.uk/2012/10/27/selenium-grid-2-0-and-remotehost-parameter/

After this feature is implemented, we should be able to run nodes like this (notice the addition of the REMOTE_HOST env variable):

docker run -d -p 5555:5555 -e REMOTE_HOST="http://1.2.3.4:5555" -e HUB_PORT_4444_TCP_ADDR="1.2.3.4" -e HUB_PORT_4444_TCP_PORT="4444" --name firefox-node selenium/node-firefox

NOTE: In example above, you would need to provide correct IP for REMOTE_HOST and HUB, not the 1.2.3.4 that I provided as an example.

docker-selenium/test.sh sanity script fails to run Firefox tests

The test.sh script is meant to run a sanity test against both node-chrome and node-firefox, but is exiting with a success status after running only the node-chrome test. It appears that the command string that gets passed to npm in the Test container (via the $TEST_CMD variable set in Test/Dockerfile and referenced in Test/package.json) is being evaluated as a binary with a list of arguments rather than a raw shell command.

The value set in Dockerfile is node smoke-chrome.js && node smoke-firefox.js but modifying the first script to print node's argument list shows:

[ 'node',
  '/usr/src/app/smoke-chrome.js',
  '&&',
  'node',
  'smoke-firefox.js' ]

This has something to do with using the environment variable in package.json rather than a literal command string. Replacing the variable reference with the actual command results in both test scripts running successfully.

'-P' option doesn't forward hub container exposed port

when i run this command docker run -P -d --name selenium-hub selenium/hub i cant access hub console. I did this command instead docker run -d -p 4444:4444 --name selenium-hub selenium/hub and i can access the console at localhost:4444

Recovering from browser crashes takes a long time

I noticed that some of my tests looks for elements that was not ready, and this causes Firefox to crash.

As each Selenium node now just runs one instance of a browser, the node will not take any new sessions as it no longer have a working browser.

The documentation for Selenium Grid claims that the default "timeout" is 30 seconds, but I end up with having 300 seconds (and I can't find any source for this change).

This results that each node is out of operation for 300 seconds before it comes back into operation. When running a lot of tests suites where some of them do a lot in parallel I would need a lot of nodes.

I've played around with two workarounds for it:

  • Allowed each node more than 1 browser instance.
  • Set the "timeout" parameter to 30 seconds for the nodes.

Both approaches gives me a reasonably quickly self-healing Selenium Grid.

What is the reasoning between just one instance per node? And is there any hidden parameters that changes the default 30 seconds, or is just that documentation outdated?

Cannot connect to VNC server

Thanks for the great work with this repo.

I'm having trouble connecting to the VNC server to debug why my selenium tests are failing. I've tried with multiple vnc clients on both mac and linux but without joy. I've also tried connecting without SSL in case the certificate missing was the issue.

I've tried connecting to:
127.0.0.1:49155
localhost:49155
selenium-hub-ip:49155
selenium-chrome-debug-ip:49155

$ docker ps
CONTAINER ID        IMAGE                               COMMAND                CREATED              STATUS              PORTS                     NAMES
0e68a29b6bf8        selenium/node-chrome-debug:2.44.0   "/opt/bin/entry_poin   About a minute ago   Up About a minute   0.0.0.0:49155->5900/tcp   angry_brown         
6bab0f7039ab        selenium/hub:2.44.0                 "java -jar /opt/sele   58 minutes ago       Up About a minute   0.0.0.0:4444->4444/tcp    selenium-hub 

Any ideas where I'm going wrong?

Standalone images

My use case doesn't require a grid.

I would like to run Selenium containers that are only used for one test.

Can we add standalone-firefox and standalone-chrome images for this use case?

Chrome setInterval() limits for inactive tab

This bug / feature in chrome means that tests take forever to run...

https://codereview.chromium.org/6577021

What happens is that chrome opens up with the Selenium window then another window (tab) is opened that starts a test. The test will progress slowly unless the original tab is selected due to inactive tab setInterval() calls being limited to at least 1000ms between calls.

-- Use WebWorker to avoid the issue --
http://stackoverflow.com/questions/5927284/how-can-i-make-setinterval-also-work-when-a-tab-is-inactive-in-chrome

-- Force it to open a new window, avoiding the limit --
http://stackoverflow.com/questions/15818892/chrome-javascript-window-open-in-new-tab

Sorry if this is not an issue with Selenuim directly but please correct me if it is an issue with the tests themselves.

Include logo.png in the root of the repo

https://docs.docker.com/docker-hub/official_repos/#a-logo

A logo

Include a logo of your company or the product (png format preferred). Only one logo is required; you don’t need additional logo files for each tag. The logo file should have the following characteristics:

  • Be named logo.png
  • Should reside in the repo for the “latest” tag
  • Should fit inside a 200px square, maximized in one dimension (preferably the width)
  • Square or wide (landscape) is preferred over tall (portrait), but exceptions can be made based on the logo needed

Add PhantomJS support.

Should really add support for PhantomJS containers.

I have an active pull request for this issue: #38

This is an issue due to the need to potentially pull this image from the public docker registry as selenium/node-phantomjs:2.44.0

Currently have this image pushed through a different account (venturetech/node-phantomjs:2.44.0), but would like to keep all of the node images with the same naming convention within my scripts.

When will a node container be ended and removed?

As stated in the readme, I like to remove the containers after each e2e test with --rm since this docker container is not meant to preserve state, I'm wondering when will each node container be stopped and removed? From what I see so far the node container simply continue running when the all test suites are completed.

Nodes with XVFB

Is there a case for providing an additional containers of browsers with XVFB?
We make extensive use of Selenium to test Flash applications and other non-headless scenarios.

Replace base image with Ubuntu

Since the phusion/baseimage has not been sanctioned as an Official Docker Repo, we need to change to one that is.

This will break the VNC support used in debugging.

An option to mitigate this until #2 is resolved is to define an image with VNC support that derives from the sanctioned node images, to which we do not seek official sanctions by docker. Then when #2 is resolved we can remove those images.

Set up some kind of CI server

This project would be a lot cooler with a continuous integration server testing pull requests. I'm thinking something like drone.io or travis-ci would be nice.

I'll look into the viability of doing Docker tests with those two and report back here. If anybody has other suggestions, I'd love to hear them.

Chrome and proxy environment variables

Chrome doesn't respect http_proxy andhttps_proxy environment variables.

I'm using the variables like this

https_proxy=http://user:[email protected]:8080
http_proxy=http://user:[email protected]:8080

I've also tried:

https_proxy=user:password@http://proxycorp.com:8080
http_proxy=user:password@http://proxycorp.com:8080

to no avail.

I've also used the uppercase variants like HTTP_PROXY and HTTPS_PROXY, with no success.

Chrome doesn't respect these environment variables.
In the debug images, I used bash to see if my environment variable exist, and they do. When I start the container in ENV I put the proxies environment variables.

Nodes will occasionally hang, seemingly forever

Firefox-Node log (Missing the last 'Done:')

21:06:53.553 INFO - Executing: [get: http://172.17.42.1:8080/])
21:06:53.599 INFO - Done: [get: http://172.17.42.1:8080/]
21:06:53.613 INFO - Executing: [find element: By.selector: [node-name='account-body'] tr])

Selenium-Hub log

21:27:54.078 INFO - Got a request to create a new session: Capabilities [{platform=ANY, firefox_profile=UEsDBBQACAAIAHt7ikUAAAAAAAAAA..., javascriptEnabled=true, browserName=firefox, version=}]
21:27:54.078 INFO - Available nodes: [host :http://172.17.0.6:5555, host :http://172.17.0.4:5555, host :http://172.17.0.5:5555, host :http://172.17.0.3:5555]
21:27:54.078 INFO - Trying to create a new session on node host :http://172.17.0.6:5555
21:27:54.078 INFO - Trying to create a new session on test slot {platform=LINUX, seleniumProtocol=WebDriver, browserName=firefox, maxInstances=1}
[ec2-user@ci ~]$ sudo docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
selenium/node-firefox   2.44.0              8f4193404eb1        3 hours ago         558.2 MB
selenium/hub            2.44.0              4a9111e45347        3 hours ago         337.8 MB

Selenium Docker NodeChrome proxy isssue

I've setup selenium grid in a private network which requires use of proxy box to access development pages, therefore I'm having to add proxy configurations to selenium docker chrome nodes.

I had a look at docker-selenium/NodeChrome/config.json (below), there isn't a key to add IP/Hostname but port is there, bit strange this. Are test team supposed to have proxy configured in test suites? Even then there should be a way to configure proxy in browser nodes. Am I missing something?

"configuration": {
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 1,
"port": 5555,
"register": true,
"registerCycle": 5000
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.