Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

need a possibility to pass options to selenium server #394

Closed
individual-it opened this issue Jan 5, 2018 · 12 comments
Closed

need a possibility to pass options to selenium server #394

individual-it opened this issue Jan 5, 2018 · 12 comments
Assignees

Comments

@individual-it
Copy link

Zalenium Image Version(s):
3.8.1e

Docker Version:
17.12.0-ce, build c97c6d6

If using docker-compose, version:

1.17.0, build ac53b73

OS:
Ubuntu

Docker Command to start Zalenium:
YML file:

# Usage:
#   docker-compose up --force-recreate
version: '3.4'

services:
  zalenium:
    image: "dosel/zalenium"
    tty: true
    volumes:
      - /tmp/videos:/home/seluser/videos
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/bin/docker:/usr/bin/docker
    ports:
      - 4444:4444
    command: >
      start --desiredContainers 1
            --maxDockerSeleniumContainers 8
            --screenWidth 1024 --screenHeight 768
            --timeZone "Europe/Berlin"
            --videoRecordingEnabled true
            --sauceLabsEnabled false
            --browserStackEnabled false
            --testingBotEnabled false
            --startTunnel false
    environment:
      - SAUCE_USERNAME
      - SAUCE_ACCESS_KEY
      - SE_OPTS=-enablePassThrough false

Expected Behavior -

selenium starting with enablePassThrough=false

Actual Behavior -

"enablePassThrough" is not passed to selenium

image

Background on 'enablePassThrough'

since 3.5 selenium has a "pass through" option, that can be set by -enablePassThrough

If set to "true" (default) all requests will be send directly to the remote site. So it's possible to use a w3c remote end (eg. geckodriver) with a w3c speaking local end (eg. a recent 3.x release of selenium)

If set to "false" the old behaviour is restored and the Selenium WebDriver protocol is translated again to the W3C WebDriver protocol.

It would be great to have a switch (in desired capabilities perhaps) to be able to select the behaviour. This is specially useful for libraries that do not yet support the W3C protocol. See comment in MinkSelenium2Driver.

Note from the selenium changelog:

Important note:
* The new standalone server and Grid Node feature a "pass through"
  mode. If you see changes to the Selenium WebDriver "logging" APIs or
  automatic capture of screenshots on error (or if you want the old
  behaviour back) you can do so by executing:
`java -jar selenium-server-standalone-3.5.3.jar -enablePassThrough false`
@diemol
Copy link
Contributor

diemol commented Jan 5, 2018

Hi @individual-it,

I think it can be implemented without so much hassle, but just to understand better, what commands are not working properly when having enablePassThrough = true?

@individual-it
Copy link
Author

@diemol basically nothing works on FF 57 and selenium 3.8 with enablePassThrough=true
I cannot even find elements by id or xpath. The reason is that the protocol was changed and only enablePassThrough=false makes selenium do the translation again see: minkphp/MinkSelenium2Driver#254 (comment)

@diemol
Copy link
Contributor

diemol commented Jan 7, 2018

Sure, we can look into adding the option, hopefully soon.

Perhaps you should also consider reporting the issues you have in the main Selenium repo? Or perhaps in the GeckoDriver one?

@diemol diemol self-assigned this Jan 7, 2018
@diemol
Copy link
Contributor

diemol commented Jan 9, 2018

Hi @individual-it,

This was just implemented, and it will be released between today and tomorrow. You'll be able to use it like this:

docker run --rm -ti --name zalenium -p 4444:4444 \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /tmp/videos:/home/seluser/videos -e SELENIUM_HUB_PARAMS="-enablePassThrough false" \
    --privileged dosel/zalenium start

I'll comment here when the release is done.

@diemol
Copy link
Contributor

diemol commented Jan 9, 2018

Hi again,

This was just released, please check https://github.com/zalando/zalenium/releases/tag/3.8.1g

Let us know if things work as expected. I'll close this issue, but feel free to reopen it in case something didn't work.

PS: Don't forget to star the project to support us :)

@diemol diemol closed this as completed Jan 9, 2018
@individual-it
Copy link
Author

individual-it commented Jan 10, 2018

Thank you for that change, I've played around with it and found out that the setting of the hub does not really matter the important setting is the one for the node.
So for anyone who might stumble about it I fixed it by adding - SELENIUM_NODE_PARAMS=-enablePassThrough false into my composer file
the Grid console still shows enablePassThrough: true but that seems not to matter

sorry @diemol if I would have discovered that setting earlier I wouldn't have send you in a spin, but I'm sure your change is helpful for a lot of people. Thank you for your support 👍

@diemol
Copy link
Contributor

diemol commented Jan 10, 2018

No worries, actually I also added SELENIUM_NODE_PARAMS in the latest release because I thought it was a good idea, but I didn't mention it since I thought the enablePassThrough was only needed in the hub 👍

@diemol
Copy link
Contributor

diemol commented Jan 10, 2018

And thanks for the quick feedback!

@mautz-et-tong
Copy link

Please reopen if this is a task for zalenium. I don't know, if this issue should be reported to elgalu/docker-selenium or belongs to this issue. I decided to start here.

The command
docker run --rm -ti --name zalenium -p 4444:4444 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/videos:/home/seluser/videos -e SELENIUM_NODE_PARAMS="-enablePassThrough false" -e SELENIUM_HUB_PARAMS="-enablePassThrough false" --privileged dosel/zalenium start leads to the following error:
Docker version 17.09.1-ce, build 19e2cf6 -- LOG 12:52:38:764528900 Ensuring docker works... -- LOG 12:52:38:814299100 Ensuring no stale Zalenium related containers are still around... -- LOG 12:52:38:835104600 Ensuring docker-selenium is available... haveged: haveged starting up Copying files for Dashboard... Starting Nginx reverse proxy... Starting Selenium Hub... ..Exception in thread "main" com.beust.jcommander.ParameterException: Was passed main parameter '-enablePassThrough' but no main parameter was defined in your arg class at com.beust.jcommander.JCommander.initMainParameterValue(JCommander.java:936) at com.beust.jcommander.JCommander.parseValues(JCommander.java:752) at com.beust.jcommander.JCommander.parse(JCommander.java:340) at com.beust.jcommander.JCommander.parse(JCommander.java:319) at org.openqa.grid.internal.cli.GridHubCliOptions.parse(GridHubCliOptions.java:37) at org.openqa.grid.selenium.GridLauncherV3$2.<init>(GridLauncherV3.java:278) at org.openqa.grid.selenium.GridLauncherV3.lambda$buildLaunchers$1(GridLauncherV3.java:277) at org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.java:163) at org.openqa.grid.selenium.GridLauncherV3.launch(GridLauncherV3.java:97) at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:81)

I assume, that there is something wrong with parsing / bypassing or recieveing the params, but honestly, I am not the Java guy, so I am not able to debug it and stopped after reading through the Dockerfiles and some scripts here.

I tested different setups and versions from zalenium down to 3.8.1. I can't get Firefox testing to work on my stack.
When I get the DockerSeleniumRemoteProxy Containers up with Chrome and Firefox, testing is not possible due to the recently known Session Error (Session [(null externalkey)] not available and is not among the last 1000 terminated sessions. ).
If I try to pass "enablePassThrough" through SE_OPTS, SELENIUM_NODE_PARAMS or SELENIUM_HUB_PARAMS the zalenium or the elgalu Containers won't start due to the error above or in some combinations the params are just ignored and not passed.

Some additional Information:
Rancher: v1.6.14
Docker (Rancher Host): 18.03.0-ce, build 0520e24
elgalu: latest
zalenium: latest - 3.11.0c

@diemol
Copy link
Contributor

diemol commented Apr 5, 2018

Hi @mautz-et-tong,

The thing is that the parameter -enablePassThrough was removed from Selenium Server itself. I think it was done in the 3.9 release. The reason for that was that people were using the flag and not really reporting the errors when using Firefox.

The status right now is that people are waiting for php-webdriver/php-webdriver#469

@mautz-et-tong
Copy link

Thanks for your answer. I will join the waiting line for the php-webdriver then.

@poison2332
Copy link

Hi guys,

When I`m trying to set node parameters, server is not starting.
Are there any docs for this feature? How to set params properly?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants