Giter Club home page Giter Club logo

zalando / zalenium Goto Github PK

View Code? Open in Web Editor NEW
2.4K 135.0 575.0 13.69 MB

A flexible and scalable container based Selenium Grid with video recording, live preview, basic auth & dashboard.

Home Page: https://opensource.zalando.com/zalenium/

License: Other

Shell 10.16% Java 82.96% CSS 0.16% HTML 2.45% AspectJ 0.57% JavaScript 1.54% Dockerfile 1.89% Smarty 0.26%
docker-selenium selenium-grid testingbot browserstack docker selenium kubernetes saucelabs testing

zalenium's Introduction

Build Status Codacy Badge codecov GitHub release Docker Pulls Slack

❗ This project is not being developed anymore. We will only reply to issues and to questions in the Zalenium Slack channel.

The last Zalenium release was 3.141.59z

From now on, we will spend our time just replying to new issues and answering questions at the Zalenium Slack channel.

Unfortunately, no new maintainers were found and this project won't be developed anymore.

The most relevant features from Zalenium are being/will be implemented in the upstream Grid 4.x, keep an eye on https://github.com/seleniumhq/docker-selenium/. You could migrate to this project in the near future.

We want to truly thank all of our users for making this a great project, helping us spread the word and improve the testing community ❤️ This project was made for the community and by the community!


This is a Selenium Grid extension to scale your local grid dynamically with docker containers. It uses docker-selenium to run your tests in Firefox and Chrome locally, if you need a different browser, your tests can get redirected to a cloud testing provider (Sauce Labs, BrowserStack, TestingBot, CrossBrowserTesting, LambdaTest). Zalenium also works out of the box in Kubernetes.

Zalenium's maintainers add new features regularly. We invite you to test it, report bugs, suggest any ideas you may have, and contribute. See our contributing guidelines for more details.

Why?

Thanks for open sourcing this. Our test suite run time has dropped from more than an hour to six minutes. — @TKueck

We know how complicated it is to:

  • Have a stable grid to run UI tests with Selenium
  • Maintain it over time (keep up with new browser, Selenium and drivers versions)
  • Provide capabilities to cover all browsers and platforms

That is why we took this approach where docker-selenium nodes are created on demand. Your UI tests in Firefox and Chrome will run faster because they are running on a local grid, on a node created from scratch and disposed after the test completes.

If you need a capability that cannot be fulfilled by docker-selenium, the test gets redirected to a cloud testing provider (Sauce Labs, BrowserStack, TestingBot, CrossBrowserTesting, LambdaTest).

Zalenium's main goal is: to allow anyone to have a disposable and flexible Selenium Grid infrastructure.

Part of the idea comes from this Sauce Labs post.

What does Zalenium mean?

As you can imagine, it is the result of mixing Zalando and Selenium. As mentioned before, this project's aim is to provide a simple way to create a grid and contribute to the Selenium community. Nevertheless, this is not an official Selenium project. We kindly ask you to create issues in this repository. If you have questions about how to get started, please join the #zalenium channel on Slack.


Contents

Getting Started

Prerequisites

  • Docker engine running, version >= 1.11.1 (probably works with earlier versions, not tested yet).

  • Make sure your docker daemon is running (e.g. docker info works without errors).

  • Pull the docker-selenium image. docker pull elgalu/selenium

  • docker pull dosel/zalenium

Run it

  • Zalenium uses docker to scale on-demand, therefore we need to give it the docker.sock full access, this is known as "Docker alongside docker".

     # Pull docker-selenium
      docker pull elgalu/selenium
    
      # Pull Zalenium
      docker pull dosel/zalenium
            
      docker run --rm -ti --name zalenium -p 4444:4444 \
        -v /var/run/docker.sock:/var/run/docker.sock \
        -v /tmp/videos:/home/seluser/videos \
        --privileged dosel/zalenium start
    • Why --privileged? We suggest you run Zalenium as --privileged to speed up the node registration process by increasing the entropy level with Haveged. Using --privileged is optional since it is just meant to improve its performance. For more information, check this tutorial.
  • Try also our one line installer and starter for OSX/Linux (it will check for the latest images and ask for missing dependencies.)

      curl -sSL https://raw.githubusercontent.com/dosel/t/i/p | bash -s start
  • More usage examples, parameters, configurations, video usage and one line starters can be seen here

  • After the output, you can check the grid console

  • Now you can point your Selenium tests to http://localhost:4444/wd/hub

  • Stop it: docker stop zalenium

Additional features

  • Video recording, check them in the /tmp/videos folder (or the one you mapped when starting Zalenium)
  • Customise video file naming via capabilities, basic auth and more

Documentation

Check the complete documentation at https://zalando.github.io/zalenium/

License

See License

Security

See Security

zalenium's People

Contributors

alfonso-presa avatar arnaud-deprez avatar axozoid avatar baflqa avatar bmaher avatar diemol avatar dkder3k avatar dspasojevic avatar ecktom avatar elgalu avatar idubnori avatar jkandasa avatar jlamaille avatar jochen-testingbot avatar juice10 avatar kanhaiya15 avatar kendalsickels-wf avatar lfeigl avatar mfstapert avatar parberge avatar pearj avatar pschuermann avatar ramapalani avatar robertzett avatar snovikov avatar takeyaqa avatar tobix avatar toshiya avatar tstern avatar yossero 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

zalenium's Issues

New way to keep dashboard history (relates to #99 and #100)

Further thinking about how make progress to solve #99 and prepare for #100 I would like to offer the following approach:

The basic idea is to store the history data in a json file instead of html.
This would provide the following advantages:

  • easily parseable and changeable, like remove entries
  • can be used to create the dashboard html via javascript on the client on demand

For this I had to do the following changes:

  • Enhance TestInformation class to store some data which previously has been generated on the fly like the date and time and browser+version
  • Add a new class TestInformationRepository responsible for storing and reading a list of tests as json and only some of the List interface methods, which are currently used. We might want to implement the complete List interface, if more List interface methods are going to be needed
  • Remove class Dashboard and add a new class DashboardDataHandler which is responsible to take care of all files copied and created for the dashboard functionality
  • Add mustache.min.js which is a templating library used to render the dashboard html
  • Rename dashboard_template.html to dashboard.html and add the ability to create the list of tests out of the dashboardData.json
  • Changed CommonProxyUtilities slightly to better support new dashboard style
  • In short the dashboard state has been kept in list.html and executedTestsInfo.json and is now combined in dashboardData.json. The number of tests with video which, if I am not mistaken, has not been used up to now is also part of dashboardData.json and could be calculated easily any time.

What did I change else?:

  • pom.xml: I changed the phase to validate for the resources plugin to have all dashboard data in place when the unit-tests are running and thus being more close to the way it is running in the docker container later and also to save some extra mocking which would be needed otherwise
  • Re-add the cleanup feature as it has been previously on my other branch

What is currently missing compared to the previous version?:

  • The previous Dashboard class always removed some dashboard data files older than a day. This is currently not included anymore because we most likely will add some kind of periodic removal configuration shortly

Where would we go next with this?

  • We need to think about periodic removal of video- and log-files. My proposal would be to add a configuration option to be used at Zalenium startup and specify the retention policy there. Like remove data older than a day
  • For #100 we only need to filter the dashboardData json. Shouldn’t be too hard. Most time will go into thinking how we provide those configuration in the UI.

Here is my current work: https://github.com/robertzett/zalenium/tree/new-dashboard-data
Please have a look at this and please tell me if it looks ok for you so far. I’ll create a pull request as soon as I had time to check why it can’t currently be merged automatically.

Error response from daemon: client is newer than server

Hello guys

Having pulled dosel/zalenium and elgalu/selenium, when I run :
docker run --rm -ti --name zalenium -p 4444:4444 -p 5555:5555 -v var/run/docker.sock:/var/run/docker.sock dosel/zalenium start
I get the following error :
Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.21)

Do you have any idea how to solve this ?

Thanks
cyrille

WebDriverException webdriver.gecko.driver

Meta -

OS: Ubuntu 16.04 64bits
Selenium Version: 3.0.1
Browser: Firefox version 47.0.1

Expected Behavior -

Get Firefox remote webdriver

Actual Behavior -

Raises exception: "WebDriverException: Message: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/jgraham/wires. The latest version can be downloaded from https://github.com/jgraham/wires"

My method to return a remote webdriver

def getWebDriver(self):
        SeleniumServer = 'http://localhost:4444/wd/hub'
        profilePath = "/mnt/firefox-profiles/" + str(self.login)
        if not os.path.exists(profilePath):
                os.makedirs(profilePath)
                ffProfile = webdriver.FirefoxProfile(profile_directory=profilePath)
        else:
                ffProfile = webdriver.FirefoxProfile(profile_directory=profilePath)
                ffCapabilities = webdriver.DesiredCapabilities.FIREFOX
                try:
                        driver = webdriver.Remote(command_executor=SeleniumServer, desired_capabilities=ffCapabilities, browser_profile=ffProfile)
                except Exception as e:
                        print "Error starting browser: " + str(e)
                else:
                        driver.set_page_load_timeout(120)
                        return driver

I have pasted the return error here: http://pastebin.com/CjSZPAnk

nodes are registered twice (once with the ip, once with localhost)

Hey guys,

I've used the command from the documentation to boot up the grid, and I saw that nodes are being registered both under localhost and both under 172.17.0.2. Check out the screenshot:
image

Is this the expected behavior? I'd like to have each node only registered ones, this seems confusing.

Free up Browserstack instances if tests fail or don't issue a quit()

We had a few tests that were doing a driver.close() instead of driver.quit() at the end. Which left the BrowserStack sessions running. BrowserStack times out orphan sessions after 90s of inactivity but Zalenium still shows the instance in use and never times out.
This queues up any further tests requiring BrowserStack capabilities.
There might be a timeout configuration missing for BrowserStack.

I can help retest or provide further details to repro. Let me know!

Add support to configure VNC default host

Hi,

I have deployed zalenium to my server and it is reachable from some url let's say test.mydomain.com. The problem is that when I try to see the tests running, I go to the url
test.mydomain.com:4444/grid/admin/live which always show this:

zalenium_live_preview

Would it be possible to add some configuration variable in which we can specify our domain?

So instead of trying to connect automatically to http://127.0.0.1:5555/proxy/... (which is not available) it will connect to http://test.mydomain.com:5555/proxy/....

The relevant code seems to be here

Thanks.

Selenium test requests waiting for a slot when slots are available

I've managed to successfully start Zalenium using the following command:

./zalenium.sh start --sauceLabsEnabled false --chromeContainers 2 --firefoxContainers 2 --maxDockerSeleniumContainers 4

However, when I kick off a test run that sends the request to a remote webdriver running at localhost:4444, I see this:

screen shot 2016-10-25 at 10 33 34 pm

Here is some more debug info:

screencapture-localhost-4444-grid-console-1477449569816

Any help would be appreciated.

ContainerNotFoundException when setting up nodes

Hi there, first of all thanks for the work done on this very helpful tool.

I tried zalenium a couple of days ago and everything worked out of the box. However today when I run zalenium I get ContainerNotFoundException which seems to prevent the containers from been created an attached to the grid/hub.

docker run --rm -ti \
    --name selenium \
    -p 4444:4444 \
    -p 5555:5555 \
    -e DOCKER=1.12 \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /tmp/videos:/home/seluser/videos \
    dosel/zalenium:2.53.1k start

I noticed zalenium:2.53.1k has been recently released so I also tried to run zalenium:2.53.1j which throws the same exception.

11:51:25.558 INFO - [DS]  Setting up 2 nodes...
11:51:27.418 ERROR - [DS] com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: da227fb1fe4f543c124a59f8e79237538116e22032597f49f5fd10e8f4237043
com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: da227fb1fe4f543c124a59f8e79237538116e22032597f49f5fd10e8f4237043
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:613)
	at com.spotify.docker.client.DefaultDockerClient.startContainer(DefaultDockerClient.java:601)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy.startDockerSeleniumContainer(DockerSeleniumStarterRemoteProxy.java:395)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy$1.run(DockerSeleniumStarterRemoteProxy.java:436)
Caused by: com.spotify.docker.client.exceptions.DockerRequestException: Request error: POST unix://localhost:80/containers/da227fb1fe4f543c124a59f8e79237538116e22032597f49f5fd10e8f4237043/start: 404
	at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2084)
	at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2045)
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:609)
	... 3 more

Environment
OS: macOS Sierra
Docker Version: 1.12.3

Logs

Docker version 1.12.3, build 6b644ec
Starting Nginx reverse proxy...
Starting Selenium Hub...
..11:51:16.288 INFO - Launching Selenium Grid hub
...11:51:17.143 INFO - binding de.zalando.tip.zalenium.servlet.live to /grid/admin/live/*
log4j:WARN No appenders could be found for logger (org.seleniumhq.jetty9.util.log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
.11:51:17.299 INFO - Will listen on 4445
11:51:17.511 INFO - Will listen on 4445
.11:51:17.699 INFO - Nodes should register to http://172.17.0.2:4445/grid/register/
11:51:17.699 INFO - Selenium Grid hub is up and running
Selenium Hub started!
Starting DockerSeleniumStarter node...
.11:51:18.273 INFO - Launching a Selenium Grid node
....11:51:19.008 INFO - Java: Oracle Corporation 25.111-b14
11:51:19.009 INFO - OS: Linux 4.4.27-moby amd64
11:51:19.021 INFO - v2.53.1, with Core v2.53.1. Built from revision a36b8b1
11:51:19.185 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
11:51:19.187 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
11:51:19.190 INFO - Driver class not found: com.opera.core.systems.OperaDriver
11:51:19.193 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
11:51:19.197 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX
11:51:19.200 INFO - Driver class not found: org.openqa.selenium.htmlunit.HtmlUnitDriver
11:51:19.202 INFO - Driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered
.11:51:19.321 INFO - Version Jetty/5.1.x
11:51:19.328 INFO - Started HttpContext[/selenium-server,/selenium-server]
11:51:19.333 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@3439f68d
11:51:19.333 INFO - Started HttpContext[/wd,/wd]
11:51:19.333 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
11:51:19.333 INFO - Started HttpContext[/,/]
11:51:19.343 INFO - Started SocketListener on 0.0.0.0:30000
11:51:19.343 INFO - Started org.openqa.jetty.jetty.Server@30b8a058
11:51:19.344 INFO - Selenium Grid node is up and ready to register to the hub
11:51:19.460 INFO - Starting auto registration thread. Will try to register every 5000 ms.
11:51:19.461 INFO - Registering the node to the hub: http://localhost:4444/grid/register
DockerSeleniumStarter node started!
Sauce Labs not enabled...
Browser Stack not enabled...
Zalenium is now ready!
*************************************** Data Processing Agreement ***************************************
By using this software you agree that the following non-PII (non personally identifiable information)
data will be collected, processed and used by Zalando SE for the purpose of improving our test
infrastructure tools. Anonymisation with respect of the IP address means that only the first two octets
of the IP address are collected.

See the complete license at https://github.com/zalando-incubator/zalenium/blob/master/LICENSE.md
*************************************** Data Processing Agreement ***************************************
Sending info to GA
11:51:25.540 INFO - [DS] Capabilities fetched from https://raw.githubusercontent.com/elgalu/docker-selenium/latest/capabilities.json
11:51:25.550 INFO - Registered a node http://172.17.0.2:30000
11:51:25.552 INFO - The node is registered to the hub and ready to use
11:51:25.558 INFO - [DS]  Setting up 2 nodes...
11:51:27.418 ERROR - [DS] com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: da227fb1fe4f543c124a59f8e79237538116e22032597f49f5fd10e8f4237043
com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: da227fb1fe4f543c124a59f8e79237538116e22032597f49f5fd10e8f4237043
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:613)
	at com.spotify.docker.client.DefaultDockerClient.startContainer(DefaultDockerClient.java:601)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy.startDockerSeleniumContainer(DockerSeleniumStarterRemoteProxy.java:395)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy$1.run(DockerSeleniumStarterRemoteProxy.java:436)
Caused by: com.spotify.docker.client.exceptions.DockerRequestException: Request error: POST unix://localhost:80/containers/da227fb1fe4f543c124a59f8e79237538116e22032597f49f5fd10e8f4237043/start: 404
	at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2084)
	at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2045)
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:609)
	... 3 more
Caused by: javax.ws.rs.NotFoundException: HTTP 404 Not Found
	at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:990)
	at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:799)
	at org.glassfish.jersey.client.JerseyInvocation.access$500(JerseyInvocation.java:91)
	at org.glassfish.jersey.client.JerseyInvocation$5.completed(JerseyInvocation.java:760)
	at org.glassfish.jersey.client.ClientRuntime.processResponse(ClientRuntime.java:197)
	at org.glassfish.jersey.client.ClientRuntime.access$300(ClientRuntime.java:78)
	at org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:179)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)
	at org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:209)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
11:51:27.865 ERROR - [DS] com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: 0113a0ae4c20241b923bb1ece434306153a333df953e830877ec20936a321067
com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: 0113a0ae4c20241b923bb1ece434306153a333df953e830877ec20936a321067
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:613)
	at com.spotify.docker.client.DefaultDockerClient.startContainer(DefaultDockerClient.java:601)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy.startDockerSeleniumContainer(DockerSeleniumStarterRemoteProxy.java:395)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy$1.run(DockerSeleniumStarterRemoteProxy.java:436)
Caused by: com.spotify.docker.client.exceptions.DockerRequestException: Request error: POST unix://localhost:80/containers/0113a0ae4c20241b923bb1ece434306153a333df953e830877ec20936a321067/start: 404
	at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2084)
	at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2045)
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:609)
	... 3 more
Caused by: javax.ws.rs.NotFoundException: HTTP 404 Not Found
	at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:990)
	at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:799)
	at org.glassfish.jersey.client.JerseyInvocation.access$500(JerseyInvocation.java:91)
	at org.glassfish.jersey.client.JerseyInvocation$5.completed(JerseyInvocation.java:760)
	at org.glassfish.jersey.client.ClientRuntime.processResponse(ClientRuntime.java:197)
	at org.glassfish.jersey.client.ClientRuntime.access$300(ClientRuntime.java:78)
	at org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:179)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)
	at org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:209)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
11:51:28.326 ERROR - [DS] com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: c6282b1e2c445f58c2db8f7fc8a22f4228f6850f5180e26dcb2952c51fc8a10c
com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: c6282b1e2c445f58c2db8f7fc8a22f4228f6850f5180e26dcb2952c51fc8a10c
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:613)
	at com.spotify.docker.client.DefaultDockerClient.startContainer(DefaultDockerClient.java:601)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy.startDockerSeleniumContainer(DockerSeleniumStarterRemoteProxy.java:395)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy$1.run(DockerSeleniumStarterRemoteProxy.java:436)
Caused by: com.spotify.docker.client.exceptions.DockerRequestException: Request error: POST unix://localhost:80/containers/c6282b1e2c445f58c2db8f7fc8a22f4228f6850f5180e26dcb2952c51fc8a10c/start: 404
	at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2084)
	at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2045)
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:609)
	... 3 more
Caused by: javax.ws.rs.NotFoundException: HTTP 404 Not Found
	at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:990)
	at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:799)
	at org.glassfish.jersey.client.JerseyInvocation.access$500(JerseyInvocation.java:91)
	at org.glassfish.jersey.client.JerseyInvocation$5.completed(JerseyInvocation.java:760)
	at org.glassfish.jersey.client.ClientRuntime.processResponse(ClientRuntime.java:197)
	at org.glassfish.jersey.client.ClientRuntime.access$300(ClientRuntime.java:78)
	at org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:179)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)
	at org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:209)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
11:51:28.797 ERROR - [DS] com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: dc057eb1ef902e5eb22a7b76af16215312b840b20250ac1dbae561b5b02faf6a
com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: dc057eb1ef902e5eb22a7b76af16215312b840b20250ac1dbae561b5b02faf6a
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:613)
	at com.spotify.docker.client.DefaultDockerClient.startContainer(DefaultDockerClient.java:601)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy.startDockerSeleniumContainer(DockerSeleniumStarterRemoteProxy.java:395)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy$1.run(DockerSeleniumStarterRemoteProxy.java:436)
Caused by: com.spotify.docker.client.exceptions.DockerRequestException: Request error: POST unix://localhost:80/containers/dc057eb1ef902e5eb22a7b76af16215312b840b20250ac1dbae561b5b02faf6a/start: 404
	at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2084)
	at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2045)
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:609)
	... 3 more
Caused by: javax.ws.rs.NotFoundException: HTTP 404 Not Found
	at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:990)
	at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:799)
	at org.glassfish.jersey.client.JerseyInvocation.access$500(JerseyInvocation.java:91)
	at org.glassfish.jersey.client.JerseyInvocation$5.completed(JerseyInvocation.java:760)
	at org.glassfish.jersey.client.ClientRuntime.processResponse(ClientRuntime.java:197)
	at org.glassfish.jersey.client.ClientRuntime.access$300(ClientRuntime.java:78)
	at org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:179)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)
	at org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:209)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
11:51:29.256 ERROR - [DS] com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: 2a524c926e406c458cde93344547812bc6062e9dd81e685f1947aec267a62136
com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: 2a524c926e406c458cde93344547812bc6062e9dd81e685f1947aec267a62136
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:613)
	at com.spotify.docker.client.DefaultDockerClient.startContainer(DefaultDockerClient.java:601)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy.startDockerSeleniumContainer(DockerSeleniumStarterRemoteProxy.java:395)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy$1.run(DockerSeleniumStarterRemoteProxy.java:436)
Caused by: com.spotify.docker.client.exceptions.DockerRequestException: Request error: POST unix://localhost:80/containers/2a524c926e406c458cde93344547812bc6062e9dd81e685f1947aec267a62136/start: 404
	at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2084)
	at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2045)
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:609)
	... 3 more
Caused by: javax.ws.rs.NotFoundException: HTTP 404 Not Found
	at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:990)
	at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:799)
	at org.glassfish.jersey.client.JerseyInvocation.access$500(JerseyInvocation.java:91)
	at org.glassfish.jersey.client.JerseyInvocation$5.completed(JerseyInvocation.java:760)
	at org.glassfish.jersey.client.ClientRuntime.processResponse(ClientRuntime.java:197)
	at org.glassfish.jersey.client.ClientRuntime.access$300(ClientRuntime.java:78)
	at org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:179)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)
	at org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:209)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
11:51:29.817 ERROR - [DS] com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: 85d9592c6c272216500f227d4b9e4d2228d7e64257d5ef74a4c1a201b00ce259
com.spotify.docker.client.exceptions.ContainerNotFoundException: Container not found: 85d9592c6c272216500f227d4b9e4d2228d7e64257d5ef74a4c1a201b00ce259
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:613)
	at com.spotify.docker.client.DefaultDockerClient.startContainer(DefaultDockerClient.java:601)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy.startDockerSeleniumContainer(DockerSeleniumStarterRemoteProxy.java:395)
	at de.zalando.tip.zalenium.proxy.DockerSeleniumStarterRemoteProxy$1.run(DockerSeleniumStarterRemoteProxy.java:436)
Caused by: com.spotify.docker.client.exceptions.DockerRequestException: Request error: POST unix://localhost:80/containers/85d9592c6c272216500f227d4b9e4d2228d7e64257d5ef74a4c1a201b00ce259/start: 404
	at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2084)
	at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2045)
	at com.spotify.docker.client.DefaultDockerClient.containerAction(DefaultDockerClient.java:609)
	... 3 more
Caused by: javax.ws.rs.NotFoundException: HTTP 404 Not Found
	at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:990)
	at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:799)
	at org.glassfish.jersey.client.JerseyInvocation.access$500(JerseyInvocation.java:91)
	at org.glassfish.jersey.client.JerseyInvocation$5.completed(JerseyInvocation.java:760)
	at org.glassfish.jersey.client.ClientRuntime.processResponse(ClientRuntime.java:197)
	at org.glassfish.jersey.client.ClientRuntime.access$300(ClientRuntime.java:78)
	at org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:179)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)
	at org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:209)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Driver fail if change platform parameter

I am running under a linux machine, if I set platform as Linux it works fine:

{'name': 'Docker 239', 'chromeOptions': {'args': [], 'extensions': []}, 'javascriptEnabled': True, 'os_version': '10', 'platform': 'LINUX', 'browserName': 'chrome', 'version': '', 'browser_version': '50.0', 'resolution': '1366x768'}
it opens the webdriver

if I set any other platform I get error like it could not find the session:

Error starting chrome: Message: Error forwarding the new session cannot find : Capabilities [{os=Windows, os_version=10, name=Docker 307, browserName=chrome, javascriptEnabled=true, chromeOptions={args=[], extensions=[]}, browser_version=50.0, version=, resolution=1366x768, platform=WINDOWS}]

Error starting chrome: Message: Error forwarding the new session cannot find : Capabilities [{os=Windows, os_version=10, name=Docker 323, browserName=chrome, javascriptEnabled=true, chromeOptions={args=[], extensions=[]}, browser_version=50.0, version=, resolution=1366x768, platform=MAC}]

Has anyone faced the same issue ?

Does zalenium support multiple workers for testing?

Sorry, more of a question that a bug report.

I see that you can specify the number of containers to run, but when I enable multiple test_workers on my selenium config, zalenium just seems to hang. Is that a known issue?

Thanks!

idleTimeout not respected

zalenium | 13:08:17.575 INFO - Got a request to create a new session: Capabilities [{acceptSslCerts=true, idleTimeout=600, browserName=firefox, javascriptEnabled=true, version=, platform=LINUX}]
zalenium | 13:08:17.586 INFO - Trying to create a new session on test slot {firefox_binary=/home/seluser/firefox-for-sel-3/firefox, seleniumProtocol=WebDriver, acceptSslCerts=true, screen-resolution=1930x1090, tz=America/Montreal, browserName=firefox, maxInstances=1, screenResolution=1930x1090, resolution=1930x1090, version=52.0.2, platform=LINUX}
zalenium | 13:10:49.651 INFO - http://localhost:40000 Marking the node as down because the test has been idle for more than 90 seconds.
zalenium | 13:10:49.651 WARN - Cleaning up stale test sessions on the unregistered node http://localhost:40000

Pass command-line options to docker-selenium

Zalenium is starting the docker-containers with a fixed set of command-line parameters, which limits the usability for others that already use docker-selenium with a broader set of command-line parameters (e.g. timezone, noVNC, resolution, etc.)

Zalenium should be able to grab somehow extra parameters to allow a more custom fitted docker-selenium configuration. One alternative is via an environment variable.

Suggested by criscodex

Performance issues

Hi all,

While using Zalenium, I've had some performance issues with the Docker containers. It's very slow to start
and to launch containers to the point where all the tests start timing out. Even when I use a fixed number of containers, some of them time out and are shut down, and it ends up being very slow waiting for the others to start. For reference, I'm usually running about 10 to 20 tests in parallel from a test run of over 150 tests, and the machine slows down considerably, and all the tests past the first one usually fail.
Is there any way, to speed up this process? Either a feature that is planned, available, or by hacking.

Thank you in advance.

Driver object to return the proxy port of the corresponding instance

Is there a way for the Driver object to return the proxy port of the corresponding instance.

I am running many instances concurrent, and I would like to keep track for instance, the current instance I am debugging, which zalenium window is this process attached to ?
for example:
localhost:40101 or 40132 or anyother ?

Restart node after run

Is it possible to restart the node after the test is done?
The reason is to always have another connection to come instead of waiting for zalenium to start a node on demand.

Thanks

Enable/disable VNC

docker-selenium provides the possibility to see the test activity through VNC. We need to figure out a default behaviour of this feature though Zalenium.

/var/log/cont/video-rec-stdout.log: No such file or directory

Hello,
I keep getting this error when starting a test:

.grep: /var/log/cont/video-rec-stdout.log: No such file or directory
.ERROR: Failed while waiting for video recording to start!

I already checked that the videos volume is mounted and it is. Also ran the container with --privileged.

Any ideas?

Feature: Allow user to specify a subdirectory for videos, in desiredCapabilities

I was hoping to use this on a Jenkins build agent, where multiple jobs might run various suites. Some of those jobs might run in parallel. I was looking to automate archiving the videos, which are currently successfuly copied by zalenium to /tmp/videos of the host running docker.

But they all get stored in that one directory. At the end of the suite, if I attempt to automate copying and clearing the videos relevant to that suite, I might copy (and clean) videos from a different suite that was running in parallel.

If I were able to set a videoSubdirectory name in the desiredCapabilities, then each suite could have it's videos "organized", if Zalenium were to copy videos to /tmp/videos/$videoSubdirectory/

Then we can reliably manipulate that specific subdirectory at the end of our suite, without worrying about stepping on any other suite's activity.

I did see that we could set the test name, which gets incorporated into the filename of the video file, but that's not sufficient if I have more than one instance of the suite (with the same tests) running at the same time.

Extra containers are launched for a browser config

Running this command
docker run --rm -ti --name zalenium -p 4444:4444 -p 5555:5555 \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /tmp/videos:/home/seluser/videos \ dosel/zalenium start --sauceLabsEnabled false

Against a Protractor test with the following config
exports.config = { seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['todo1-spec.js', 'todo2-spec.js'], multiCapabilities: [{ 'browserName': 'firefox' } ,{ 'browserName': 'chrome', shardTestFiles: true, maxInstances: 2 } ],

Launches 4 additional Firefox containers. Expected only additional Chrome containers. Also, it seems that once the tests are completed, Zalenium doesn't remove any of the stopped containers that were spawned, as well as stopping a couple of the extra Firefox containers.
image

Running tests inside Jenkins which is inside docker container

I have a problem with zalenium:

We are running jenkins inside docker container as well as zalenium with docker-selenium. Jenkins network is not linked to zalenium containers (could be solved however). So I run my tests inside local docker network (172.17.0.1:4444), however it seems my tests cannot get connected to selenium node, because in the configuration it is bound to localhost, so it tries to connect to localhost, here are my logs from the tests:

[19:09:25] I/hosted - Using the selenium server at http://172.17.0.1:4444/wd/hub
[19:11:16] E/launcher - cannot forward the request localhost:40002 failed to respond
[19:11:16] E/launcher - WebDriverError: cannot forward the request localhost:40002 failed to respond

Everything works if I run tests on the host server, not inside container. I assume it wont work if I run zalenium on server1 and then on server2 try to run my tests, as there is no way to configure nodes (to make them non-localhost).

Is there any other way to fix the problem than linking containers or tunneling networks?

some times containers are not destroyed after the run

I have been using it to run the protractor test cases, Some times when i run test cases, Zalenium creates 3 containers and run test cases in them. But after test finishes, Those three are remaining in on(not destroyed). and in next run we have 6 out of which 3 are not used and just sitting there.

Do you guys require more information. Let me know. I am facing this issue a lot.

P.S : I have very new to open source community to please bear with me

kubernetes support

Hi,

I'm wondering if there are any plans to add kubernetes support?

I realise that zalenium as it stands is very tied to using the docker command directly. But with a bit of refactoring, I think it wouldn't be too hard to have a zalenium-docker and a zalenium-kubernetes version if the core bits of zalenium were moved to a separate maven artifact and the docker specific parts moved to another maven artefact, which would allow a kubernetes version.

Thoughts?

Video recording failure with Java exception

We have Travis integration of Zalenium and recently we faced with this:

hub_1           | 17:47:38.653 INFO - http://localhost:40000 [bash, -c, start-video]

hub_1           | 17:47:39.133 ERROR - http://localhost:40000java.lang.RuntimeException: java.io.IOException: Connection reset by peer

hub_1           | java.lang.RuntimeException: java.io.IOException: Connection reset by peer

hub_1           | 	at com.google.common.base.Throwables.propagate(Throwables.java:240)

hub_1           | 	at com.spotify.docker.client.DefaultLogStream.computeNext(DefaultLogStream.java:58)

hub_1           | 	at com.spotify.docker.client.DefaultLogStream.computeNext(DefaultLogStream.java:35)

hub_1           | 	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:145)

hub_1           | 	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:140)

hub_1           | 	at com.spotify.docker.client.DefaultLogStream.readFully(DefaultLogStream.java:77)

The log is available here:
https://travis-ci.org/Gizra/drupal-elm-starter/jobs/237544124

That's how we start the things:
https://github.com/Gizra/drupal-elm-starter/blob/master/ci-scripts/docker_files/docker-compose.yml

Orphan containers are created after a cleanup loop

I use the grid to work with a firefox and chrome containers, and end my sessions between tests.
In the 1st test, the initial containers are used, then disposed, and everything's great.
Then I start another test cycle, and a redundant chrome container is created, though no session is opened on it.
This behavior is reproduced for every test cycle, until I reach the max container limit, and the new session request is queued forever.

The log with my comments in [[[]]]:

10:19:37.395 INFO - [DS] Capabilities grabbed from the docker-selenium image
10:19:37.401 INFO - The node is registered to the hub and ready to use
10:19:37.407 INFO - Registered a node http://172.17.0.8:30000
10:19:37.417 INFO - [DS]  Setting up 2 nodes...
10:19:38.122 INFO - 2 containers were created, it will take a bit more until all get registered.
10:19:43.391 INFO - Registered a node http://localhost:40000
10:19:43.869 INFO - Registered a node http://localhost:40001
10:20:00.511 INFO - Got a request to create a new session: Capabilities [{rotatable=true, locationContextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@212e1d7f, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}]
10:20:00.516 INFO - Trying to create a new session on test slot {firefox_binary=/home/seluser/firefox-for-sel-3/firefox, seleniumProtocol=WebDriver, acceptSslCerts=true, browserName=firefox, maxInstances=1, version=51.0.1, platform=LINUX}
10:20:00.531 INFO - Got a request to create a new session: Capabilities [{rotatable=true, locationContextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@3f126dc1, browserName=chrome, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}]
10:20:00.550 INFO - localhost:40001 start-video: Video recording is disabled
10:20:00.569 INFO - Trying to create a new session on test slot {chrome_binary=/usr/bin/google-chrome-stable, seleniumProtocol=WebDriver, acceptSslCerts=true, browserName=chrome, maxInstances=1, version=56.0.2924.87, platform=LINUX}
10:20:00.570 INFO - localhost:40000 start-video: Video recording is disabled
10:20:15.808 INFO - localhost:40000 STOP_SESSION command received. Node should shutdown soon...
10:20:15.953 INFO - localhost:40001 STOP_SESSION command received. Node should shutdown soon...
10:20:15.968 INFO - localhost:40000 stop-video: Video recording is disabled
10:20:16.392 INFO - localhost:40001 stop-video: Video recording is disabled
10:20:18.275 INFO - localhost:40000 Marking the node as down because it was stopped after 1 tests.
10:20:18.275 INFO - localhost:40000 Marking the node as down because it was stopped after 1 tests.
10:20:18.276 WARN - Cleaning up stale test sessions on the unregistered node http://localhost:40000
10:20:19.029 INFO - localhost:40001 Marking the node as down because it was stopped after 1 tests.
10:20:19.030 INFO - localhost:40001 Marking the node as down because it was stopped after 1 tests.
10:20:19.030 WARN - Cleaning up stale test sessions on the unregistered node http://localhost:40001

[[[Everything is great, all containers were disposed of]]]

10:20:30.683 INFO - Got a request to create a new session: Capabilities [{rotatable=true, locationContextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@18caf784, browserName=chrome, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}]
10:20:30.686 INFO - [DS] Starting new node for {rotatable=true, locationContextEnabled=true, loggingPrefs={driver=ALL, browser=ALL}, browserName=chrome, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}.

[[[Here's the crux of the problem - I request a firefox container, but the response issues a new chrome container]]]

10:20:30.686 INFO - Got a request to create a new session: Capabilities [{rotatable=true, locationContextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@5fc81dd9, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}]
10:20:30.904 INFO - [DS] Starting new node for {rotatable=true, locationContextEnabled=true, loggingPrefs={driver=ALL, browser=ALL}, browserName=chrome, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}.


10:20:31.093 INFO - [DS] Starting new node for {rotatable=true, locationContextEnabled=true, loggingPrefs={driver=ALL, browser=ALL}, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}.
10:20:36.521 INFO - [DS] Starting new node for {rotatable=true, locationContextEnabled=true, loggingPrefs={driver=ALL, browser=ALL}, browserName=chrome, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}.
10:20:36.562 INFO - [DS] Starting new node for {rotatable=true, locationContextEnabled=true, loggingPrefs={driver=ALL, browser=ALL}, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}.
10:20:38.988 INFO - Registered a node http://localhost:40002
10:20:39.009 INFO - Trying to create a new session on test slot {chrome_binary=/usr/bin/google-chrome-stable, seleniumProtocol=WebDriver, acceptSslCerts=true, browserName=chrome, maxInstances=1, version=56.0.2924.87, platform=LINUX}
10:20:39.011 INFO - localhost:40002 start-video: Video recording is disabled
10:20:39.013 INFO - [DS] Starting new node for {rotatable=true, locationContextEnabled=true, loggingPrefs={driver=ALL, browser=ALL}, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}.
10:20:39.628 INFO - Registered a node http://localhost:40003
10:20:39.631 INFO - [DS] Starting new node for {rotatable=true, locationContextEnabled=true, loggingPrefs={driver=ALL, browser=ALL}, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}.
10:20:39.675 INFO - [DS] Starting new node for {rotatable=true, locationContextEnabled=true, loggingPrefs={driver=ALL, browser=ALL}, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}.
10:20:40.180 INFO - Registered a node http://localhost:40004
10:20:40.180 INFO - [DS] Starting new node for {rotatable=true, locationContextEnabled=true, loggingPrefs={driver=ALL, browser=ALL}, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.1, url=http://webdriver.io}}.
10:20:40.203 INFO - Trying to create a new session on test slot {firefox_binary=/home/seluser/firefox-for-sel-3/firefox, seleniumProtocol=WebDriver, acceptSslCerts=true, browserName=firefox, maxInstances=1, version=51.0.1, platform=LINUX}
10:20:40.203 INFO - localhost:40004 start-video: Video recording is disabled
10:20:55.403 INFO - localhost:40002 STOP_SESSION command received. Node should shutdown soon...
10:20:55.530 INFO - localhost:40002 stop-video: Video recording is disabled
10:20:55.586 INFO - localhost:40004 STOP_SESSION command received. Node should shutdown soon...
10:20:55.762 INFO - localhost:40004 stop-video: Video recording is disabled
10:20:57.808 INFO - localhost:40002 Marking the node as down because it was stopped after 1 tests.
10:20:57.808 INFO - localhost:40002 Marking the node as down because it was stopped after 1 tests.
10:20:57.808 WARN - Cleaning up stale test sessions on the unregistered node http://localhost:40002
10:20:57.854 INFO - localhost:40004 Marking the node as down because it was stopped after 1 tests.
10:20:57.855 INFO - localhost:40004 Marking the node as down because it was stopped after 1 tests.
10:20:57.855 WARN - Cleaning up stale test sessions on the unregistered node http://localhost:40004

Feature - Node mount folder

Hi,

I need to mount a folder from host or zalenium container(hub) in all selenium containers (nodes), can you add this?

Exemple:

docker run --rm -ti --name zalenium -d -p 4444:4444 -p 5555:5555 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/videos:/home/seluser/videos dosel/zalenium start --mount /mnt:/mnt

Choose VNC port

Hi, is there a way to customize the ports that are used by the nodes' VNC for the live preview? and how are the ports chosen?

Question: Scaling Horizontally

Hi,

From what i understood of Zalenium, you can only scale by increasing machine specs. Is it possible to run zalenium as a "classic" Selenium-Grid (Hub + serveral nodes on distinct machines).

Thanks in advance

EDIT: Sorry for the question in the issue section. Didn't know where to ask this :)

[Dashboard] Cleanup feature

Because usually we try to keep our CI environments as clean as we can, it would be nice to have a cleanup feature for the dashboard, in case Zalenium is set up to keep running, as a selenium grid for testing on multiple applications (thus multiple Jenkins jobs running on the same hub).
At first I'm thinking of a simple button to remove all entries, then this could be implemented with custom settings, like:

  • auto-remove entries which are older than x no of days/weeks/months.
  • only remove logs, keep the videos
  • only remove videos, keep the logs
    etc. you-name-it

[Dashboard] Filter test results

Another neat feature that I'd like to see in the dashboard, is the ability to search for/filter out test results:

  • by test execution date (today, last 3 days, last week etc)
  • by test name (I only want to see the results for 'Test xy')

Show test name in live preview

Would it be possible to show the currently executing test name in the live preview instead of "DockerSeleniumRemoteProxy"?

image

Group live previews

Hi,
I have a use case in which more than one developer is using the same Zalenium instance to run the tests from his computer, thus it is difficult to tell which live preview belongs to the tests they are running.

Would it be possible to group the live preview containers by a customer parameter sent in the driver capabilities? Something like machine name, so that they can easily tell which current executing tests belong to them.

VNC artifacts

Hi,

I have been experiencing some issues when I try to see the tests running in http://mydomain:4444/grid/admin/live. The VNC live preview is not rendered correctly and shows some artifacts as you can see in the attached GIF.

vnc_artifacts

It is only happening on Linux. I tested it in my local machine (macOS) and I was not able to reproduce it.

I suspect it has something to do with mounting /dev/shm from the host. I had the same problem when using elgalu/selenium and then mounting /dev/shm. However it works fine if I use --shm-size flag instead.

enhancement: need some kind of video/log qty limit (sliding window, etc)

Hi,

Our implementation would have zalenium running for a long time in a CI environment, with quite a few tests and videos. I'm handling archiving them to an external share (the subdirectory enhancement I logged will help keep things organized in /tmp/videos, but that's different than the issue I'm describing here).

If I understand things correctly, Zalenium doesn't currently limit the qty of videos & logs retained -- it just goes on forever until the container is rebuilt. For a CI environment with lots of tests, this could be a problem.

I see the URL for the "cleanAll", but I'm not looking to delete everything, as that might step on others currently recording. What I'm really looking for is options like:

maxNmberOfTestVideosAndLogsToKeep =

or, when the 'builds' functionality is implemented,

maxNumberOfBuildsToRetain = (regardless of how many videos and logs are in each "build" (suite)

Both could be a sliding window, any > x, oldest are deleted first. And would hope that the index.html could be adjusted so that it reflects these changes.

PhantomJS or Chrome headless

Any chance of having either PhantomJS or Chrome headless as an option seeing as Xvfb uses a lot CPU and Memory. I cant get to 100 Chrome instances on 16 cores but I can with PhantomJS.

I built a working version of PhantomJS 2.1.1 with a custom ghostdriver which connects from a Docker container and allows a return connection.

https://github.com/madhavajay/selenium-node-phantomjs

Service runs out of ports after running for a while

I've noticed that after running a service for 2-3 days in our high-traffic test environment the service would run of free ports and would be in "zombie" state - it appears alive but no new session can be started.

I traced it to the following area of the code - once the port is allocated it is never released back:

private int findFreePortInRange(int lowerBoundary, int upperBoundary) throws IllegalStateException {
        for (int portNumber = lowerBoundary; portNumber <= upperBoundary; portNumber++) {
               ...
                if (freePort != -1) {
                    allocatedPorts.add(freePort);
                    return freePort;
                }
            }
        }
        throw new IllegalStateException("Could not find a free TCP/IP port to use for docker-selenium");
    }

Is this known issue?

The simplest graceful solution would be to use something like CircularFifoQueue<> (Apache Commons Collections 4) instead of ArrayList to hold ports, the most thorough solution is to clean up ports on session end/container cleanup.

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.