Selenium: Grid does not handle w3c capabilities correctly

Created on 11 Apr 2017  Â·  76Comments  Â·  Source: SeleniumHQ/selenium

Meta -

OS: Mac OS El Capitan 10.11.6

Selenium Version: 3.3.3

Browser: Firefox

Browser Version: 52.0.2 (64-bit)

Expected Behavior -

In python, the following should create a Remote driver:

from selenium import webdriver

cap = {'platform': 'ANY', 'browserName': 'firefox', 'version': '', 'marionette': True, 'javascriptEnabled': True}
driver = webdriver.Remote(command_executor='http://:4444/wd/hub', desired_capabilities=cap)

(note: this works with selenium 2.53.6 with python2.7 when executed against the same server)

Actual Behavior -

Thows exception: KeyError: 'message'

When I pdb into this I see the following response from the server:

{'value': '{"status":13,"value":{"class":"java.lang.NullPointerException","stackTrace":[{"fileName":"HashMap.java","className":"java.util.HashMap","methodName":"putMapEntries","lineNumber":500},{"fileName":"HashMap.java","className":"java.util.HashMap","methodName":"putAll","lineNumber":784},{"fileName":"DesiredCapabilities.java","className":"org.openqa.selenium.remote.DesiredCapabilities","methodName":"\u003cinit\u003e","lineNumber":54},{"fileName":"RequestHandler.java","className":"org.openqa.grid.web.servlet.handler.RequestHandler","methodName":"process","lineNumber":104},{"fileName":"DriverServlet.java","className":"org.openqa.grid.web.servlet.DriverServlet","methodName":"process","lineNumber":83},{"fileName":"DriverServlet.java","className":"org.openqa.grid.web.servlet.DriverServlet","methodName":"doPost","lineNumber":67},{"fileName":"HttpServlet.java","className":"javax.servlet.http.HttpServlet","methodName":"service","lineNumber":707},{"fileName":"HttpServlet.java","className":"javax.servlet.http.HttpServlet","methodName":"service","lineNumber":790},{"fileName":"ServletHolder.java","className":"org.seleniumhq.jetty9.servlet.ServletHolder","methodName":"handle","lineNumber":841},{"fileName":"ServletHandler.java","className":"org.seleniumhq.jetty9.servlet.ServletHandler","methodName":"doHandle","lineNumber":543},{"fileName":"ScopedHandler.java","className":"org.seleniumhq.jetty9.server.handler.ScopedHandler","methodName":"nextHandle","lineNumber":188},{"fileName":"SessionHandler.java","className":"org.seleniumhq.jetty9.server.session.SessionHandler","methodName":"doHandle","lineNumber":1584},{"fileName":"ScopedHandler.java","className":"org.seleniumhq.jetty9.server.handler.ScopedHandler","methodName":"nextHandle","lineNumber":188},{"fileName":"ContextHandler.java","className":"org.seleniumhq.jetty9.server.handler.ContextHandler","methodName":"doHandle","lineNumber":1228},{"fileName":"ScopedHandler.java","className":"org.seleniumhq.jetty9.server.handler.ScopedHandler","methodName":"nextScope","lineNumber":168},{"fileName":"ServletHandler.java","className":"org.seleniumhq.jetty9.servlet.ServletHandler","methodName":"doScope","lineNumber":481},{"fileName":"SessionHandler.java","className":"org.seleniumhq.jetty9.server.session.SessionHandler","methodName":"doScope","lineNumber":1553},{"fileName":"ScopedHandler.java","className":"org.seleniumhq.jetty9.server.handler.ScopedHandler","methodName":"nextScope","lineNumber":166},{"fileName":"ContextHandler.java","className":"org.seleniumhq.jetty9.server.handler.ContextHandler","methodName":"doScope","lineNumber":1130},{"fileName":"ScopedHandler.java","className":"org.seleniumhq.jetty9.server.handler.ScopedHandler","methodName":"handle","lineNumber":141},{"fileName":"HandlerWrapper.java","className":"org.seleniumhq.jetty9.server.handler.HandlerWrapper","methodName":"handle","lineNumber":132},{"fileName":"Server.java","className":"org.seleniumhq.jetty9.server.Server","methodName":"handle","lineNumber":564},{"fileName":"HttpChannel.java","className":"org.seleniumhq.jetty9.server.HttpChannel","methodName":"handle","lineNumber":320},{"fileName":"HttpConnection.java","className":"org.seleniumhq.jetty9.server.HttpConnection","methodName":"onFillable","lineNumber":251},{"fileName":"AbstractConnection.java","className":"org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback","methodName":"succeeded","lineNumber":279},{"fileName":"FillInterest.java","className":"org.seleniumhq.jetty9.io.FillInterest","methodName":"fillable","lineNumber":112},{"fileName":"ChannelEndPoint.java","className":"org.seleniumhq.jetty9.io.ChannelEndPoint$2","methodName":"run","lineNumber":124},{"fileName":"QueuedThreadPool.java","className":"org.seleniumhq.jetty9.util.thread.QueuedThreadPool","methodName":"runJob","lineNumber":672},{"fileName":"QueuedThreadPool.java","className":"org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2","methodName":"run","lineNumber":590},{"fileName":"Thread.java","className":"java.lang.Thread","methodName":"run","lineNumber":745}]}}', 'status': 500}

Steps to reproduce -

Execute the above steps in python using selenium 3.3.3, firefox 52.0.2, geckodriver 0.15.0. The server is using selenium-server-standalone-3.3.1.jar on ubuntu 16.10. I'm happy to provide the ip of the server privately if it'll help.

C-grid

Most helpful comment

How is the fix for this progressing? Is there anything that be provided by the community to help get this implemented and released?

All 76 comments

Also, testing with curl seems to work fine:

curl -v -X POST http://:4444/wd/hub/session -d '{"desiredCapabilities":{"browserName":"firefox", "marionette": "true", "javascriptEnabled": "true"}}'

curl -v 'http://:4444/wd/hub/session/SESSION_ID'

Ok, looks it actually works if I change the port to 5555.

I'm guessing that's connecting directly to a node rather than the hub? Why would port 4444 work with selenium 2.5 but not 3.3.3?

I met the same issue. and Using the same command on selenium 3.3.0 working fine. Now I'm downgrade to 3.3.0.

In [1]: from selenium.webdriver import *

In [2]: dri = Remote('http://my_sever_ip:4444/wd/hub', DesiredCapabilities.HTMLUNIT)

KeyError Traceback (most recent call last)
in ()
----> 1 dri = Remote('http://my_server_ip:4444/wd/hub', DesiredCapabilities.HTMLUNIT)

/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in __init__(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector)
96 warnings.warn("Please use FirefoxOptions to set browser profile",
97 DeprecationWarning)
---> 98 self.start_session(desired_capabilities, browser_profile)
99 self._switch_to = SwitchTo(self)
100 self._mobile = Mobile(self)

/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in start_session(self, capabilities, browser_profile)
183 parameters = {"capabilities": w3c_caps,
184 "desiredCapabilities": capabilities}
--> 185 response = self.execute(Command.NEW_SESSION, parameters)
186 if 'sessionId' not in response:
187 response = response['value']

/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params)
247 response = self.command_executor.execute(driver_command, params)
248 if response:
--> 249 self.error_handler.check_response(response)
250 response['value'] = self._unwrap_value(
251 response.get('value', None))

/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response)
108 value = message
109 try:
--> 110 message = message['message']
111 except TypeError:
112 message = None

KeyError: 'message'

In [3]: exit

I have the same issue with Selenium python client 3.3.2 or 3.3.3 against a Selenium server 3.3.1. It works with Selenium python client 3.3.1.

The problem has been introduced with commit https://github.com/SeleniumHQ/selenium/commit/abe1f45be59d1064d4ca353cb7278d455990c398. It uses the new W3C start session (send "capabilities" instead of "requiredCapabilities"), but it seems that Selenium 3.3.1 server still needs "requiredCapabilities".

I have downgraded selenium, selenium standalone server and it works fine.

I can create Remote driver if run server locally as
java -jar selenium-server-standalone-3.3.1.jar

But it fails for a local grid started as:

java -jar selenium-server-standalone-3.3.1.jar -role hub
java -jar selenium-server-standalone-3.3.1.jar -role node

I found that this grid works only with "selenium-server-standalone-2.53.1.jar", but do not even with the first 3.x one "selenium-server-standalone-3.0.0.jar"

I use python 3.6, selenium 3.3.3, and command

 wd = webdriver.Remote("http://192.168.50.30:4444/wd/hub",desired_capabilities=DesiredCapabilities.CHROME)

Here is a full stacktrace using the python bindings 3.4.0 with selenium server (in grid hub/node mode) : https://gist.github.com/smccarthy/6778f2af97b99e301767438de01c62fb

I tried with chromedriver 2.28 and 2.29 , but I seem to get the same issue with DesiredCapabilities.FIREFOX

This appears to be a grid issue, it does not like 'capabilities' being in the parameters for new session

@shs96c you'd probably be best at handling the fix for this

Is there any update on this? I am still stuck on 3.0.1 because of this bug.

I'm having the same issue using the .Net bindings on the client side.

OS: Windows 10
Selenium Version: 3.4
Browser: Chrome
Browser Version: 57
Grid Version (Hub & Node): 3.4

I was testing this setup with a locally running hub and node on my dev laptop before upgrading our actual grid. Anytime I request a browser directly from the hub, I get an error. This is not a problem using 3.3 nor is it a problem using 3.4 when I bypass the grid and use a local browser.

@bjharo see @jimevans's explanation here https://github.com/SeleniumHQ/selenium/issues/3929#issuecomment-298186607

And the reason it's showing up now is that 3.4 is the first release to consistently attempt to send the W3C spec-compliant payload for a new session command (containing a capabilities property) across the wire. This is where the bug is in the hub code.

Do we have any work around of it?

I also am seeing this problem. My workaround in Python has been to force an earlier version of selenium when installing. I.e., pip3 uninstall selenium && pip3 install selenium==3.3.1

As a workaround this is what worked for me....go into the selenium webdriver client

I am using python client

go into the remote/webdriver.py

you will see this within the start_session(some args) method

parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}

remove the "capabilities": w3c_caps

so you end up with:

parameters = { "desiredCapabilities": capabilities}

I am sure that this is very similar to the other client bindings. Just a temporary workaround until this can be fixed.

I just tried to compile the webdriver (.NET for me) according to the remark of @Grimlek and it works but the capabilities used doesn't respect the json mentioned in that page https://github.com/w3c/webdriver/pull/327
I tried to compile the selenium-server-standalone and remove the desiredCapabilities according to the remark of @lmtierney . That works too with the .NET webdriver. I saw the code behind the .NET webdriver and python webdriver and it seems that the object capabilities is not filled the same way just for this 2 drivers.

For .NET

Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("desiredCapabilities", this.GetLegacyCapabilitiesDictionary(desiredCapabilities));

            Dictionary<string, object> firstMatchCapabilities = this.GetCapabilitiesDictionary(desiredCapabilities);

            List<object> firstMatchCapabilitiesList = new List<object>();
            firstMatchCapabilitiesList.Add(firstMatchCapabilities);

            Dictionary<string, object> specCompliantCapabilities = new Dictionary<string, object>();
            specCompliantCapabilities["firstMatch"] = firstMatchCapabilitiesList;
            parameters.Add("capabilities", specCompliantCapabilities);

            Response response = this.Execute(DriverCommand.NewSession, parameters);

desiredCapabilities and capabilities are filled but desiredCapabilities is no more used if capabilities is set in the function extractDesiredCapability. Maybe some code must be removed over here.

But when you look at the python version, the content is not the same

w3c_caps = {"firstMatch": [], "alwaysMatch": {}}
...
w3c_caps["alwaysMatch"].update(capabilities)
parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}

For the python version, firstMatch is never set but alwaysMatch is set.

For the moment i'm glad that the selenium-server-standalone is working again on my server but the code i saw is really odd and i don't know what must be done

I'm getting the following Exception when I try to do what @Grimlek suggested. Note: I have already downgraded to Selenium Standalone Server version 3.3.0. What am I doing wrong?

selenium.common.exceptions.WebDriverException: Message: Error forwarding the new session cannot find : Capabilities [{marionette=true, acceptInsecureCerts=true, browserName=firefox, version=8.1, platform=WINDOWS}]
Stacktrace:
at org.openqa.grid.web.servlet.handler.RequestHandler.process (RequestHandler.java:112)
at org.openqa.grid.web.servlet.DriverServlet.process (DriverServlet.java:83)
at org.openqa.grid.web.servlet.DriverServlet.doPost (DriverServlet.java:67)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle (ServletHolder.java:841)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle (ServletHandler.java:543)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle (ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle (SessionHandler.java:1584)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle (ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle (ContextHandler.java:1228)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope (ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope (ServletHandler.java:481)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope (SessionHandler.java:1553)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope (ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope (ContextHandler.java:1130)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle (ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle (HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle (Server.java:564)
at org.seleniumhq.jetty9.server.HttpChannel.handle (HttpChannel.java:320)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable (HttpConnection.java:251)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded (AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable (FillInterest.java:112)
at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run (ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred (Invocable.java:122)
at org.seleniumhq.jetty9.util.thread.strategy.ExecutingExecutionStrategy.invoke (ExecutingExecutionStrategy.java:58)
at org.seleniumhq.jetty9.util.thread.strategy.ExecuteProduceConsume.produceConsume (ExecuteProduceConsume.java:201)
at org.seleniumhq.jetty9.util.thread.strategy.ExecuteProduceConsume.run (ExecuteProduceConsume.java:133)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:672)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run (QueuedThreadPool.java:590)
at java.lang.Thread.run (:-1)

Process finished with exit code 1

@shs96c Apologize for asking, but is there a timeline for this to be resolved? We are trying to embrace the latest selenium-java releases, but this issue (plus inability to set proxy) prevents use from using Selenium v3.4, GeckoDriver v0.16.1 or even using legacy (via FirefoxOptions.setLegacy(true)) as a workaround, since we cannot match on browserVersion=47.0.1

@schmidtkp If I'm not mistaken, he has a fix ready but hasn't been tested fully yet. I believe he's very busy for the next few days but will get back to it when he can

@lmtierney @shs96c Excellent news on both fronts! Congrats Simon!

I volunteer for any testing efforts. I have Windows 8.1, and I use Python 3.5.x
and Selenium 3.4.0.

Thanks.

@lmtierney Is there any update on release for proxy support in selenium v3.4?

Issues will be updated if there are any updates

I am blocked for this operation with 3.4.0 FF 53.0.2 mean time what version should i use now. Please suggest me any other version for FF and Selenium

my issue is below
InvalidArgument # new Actions(driver).moveToElement(element).click().perform() not working with 3.4.0 FF 53.0.2 #4049

@vlakkara I guess Selenium 2 & FF 47

@vlakkara Selenium 3.3.1 still works with Firefox 47 if you use the legacy driver.

I'm using Selenium 3.4.0 with Python 3.5.2 and Chrome, and
I'm getting an exception with Message: None. I am told that
that problem is the same as this one. My problem has been
duplicated to this one.

Can some please provide me the complete workaround and
the detailed steps to make it work? I am getting bits and
pieces of information of what would work - like adjusting the
desired capabilities, downgrading to a lower version of Selenium
etc., but nothing seem to work in isolation and may be I need
to do a couple of things together to make it work.

Can someone enlighten me? Thanks.

On Wed, May 31, 2017 at 5:08 PM, bjharo notifications@github.com wrote:

@vlakkara https://github.com/vlakkara Selenium 3.3.1 still works with
Firefox 47 if you use the legacy driver.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/SeleniumHQ/selenium/issues/3808#issuecomment-305164783,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMdHN5mWks_otd9p2ThBA7Xkum0KkEkaks5r_VEygaJpZM4M5en1
.

--
Did you know that you can plant trees just by
using http://www.ecosia.org as your search
engine? It's that simple. Check the website for
more details and help protect our environment
and the Earth!

Hello @VenkatArchitect

Can some please provide me the complete workaround and
the detailed steps to make it work?

I've discovered following solution for .Net and tried to adapt it for Python

  1. Download/Fork etc. Selenium 3.4.0 sources from git
  2. Open sources in any Python IDE or using any preferred by you way to do following:
    2.1. Found corresponding line in sources using this code line link
    2.2. change this code
parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}

to following code
parameters = {"desiredCapabilities": capabilities}
2.3. Compile sources
2.4. Use compiled lib in your project

What is w3c_caps?

What is w3c_caps?

You will find answers here : https://github.com/w3c/webdriver/pull/327

@InkUisitor eh? I can't find for that in that issue. Is it a local variable that contains certain capabilities?

Can someone confirm what the correct combination of versions of selenium grid and the webdriver api client are required to get this working on .NET?

I've tried combinations of 3.1 to 3.3 for both and keep getting the error.

How is the fix for this progressing? Is there anything that be provided by the community to help get this implemented and released?

Echoing Matthew here.
In particular in Java I wanted to try and test after building the selenium standalone server following these steps https://github.com/SeleniumHQ/selenium/wiki/Building-WebDriver#tips
But I'm not sure what a possible fix could be in the Java code.
I was looking into https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java but there's no reference to w3c_caps the python code has in the webdriver code as mentioned above in the thread.

For now even a workaround to be tested by us would be great, like a different json of the capabilities to be used in the case of remote webdriver for firefox?

I'm a bit disappointed at this, I'm setting up a new project and I'm not really willing to move backward on the selenium version at this early stage (being frozen on an old version is a BadThing(TM) generally). Without a usable workaround I'm going to have to ditch Selenium Grid until this is resolved.

Also: I was attempting to run Selenium Grid from python 3.6.1 with Hub on Windows, and a Node under RedHat Enterprise Linux 7. AFAICT, selenium Grid 3.4 doesn't work on any platform. If that isn't the case, please comment here, or if there is a workaround.

Can we get a timeline please of this fix?
its been months now

We also faced with issue "UnsupportedCommandException mouseMoveTo with 3.4 on firefox with geckodriver 0.16.1".
Drag n drop doesn't work, any ETA of fix this issue?

I've added a "-enablePassThrough" flag to the standalone server. With this in place, and a few tweaks to Grid, 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) It'll be in 3.5

Notably, this means that you'll need to start the nodes with "-enablePassThrough".

@shs96c I've just tried building from master, and I get the same result with or without the -enablePassThrough command line argument.

Using Python client 3.4.3 with Selenium a42e31a8d143565aa0afea553943d880f1abc021:

from selenium.webdriver import Remote
driver = Remote(command_executor='http://localhost:4444/wd/hub', desired_capabilities={'browserName': 'firefox'})

Raises the following exception:

WebDriverException: Message: None
Stacktrace:
    at java.util.HashMap.putMapEntries (HashMap.java:500)
    at java.util.HashMap.putAll (HashMap.java:784)
    at org.openqa.selenium.remote.DesiredCapabilities.<init> (DesiredCapabilities.java:55)
    at org.openqa.grid.web.servlet.handler.RequestHandler.process (RequestHandler.java:104)
    at org.openqa.grid.web.servlet.DriverServlet.process (DriverServlet.java:84)
    at org.openqa.grid.web.servlet.DriverServlet.doPost (DriverServlet.java:68)
    at javax.servlet.http.HttpServlet.service (HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service (HttpServlet.java:790)
    at org.seleniumhq.jetty9.servlet.ServletHolder.handle (ServletHolder.java:841)
    at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle (ServletHandler.java:543)
    at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle (ScopedHandler.java:188)
    at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle (SessionHandler.java:1584)
    at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle (ScopedHandler.java:188)
    at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle (ContextHandler.java:1228)
    at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope (ScopedHandler.java:168)
    at org.seleniumhq.jetty9.servlet.ServletHandler.doScope (ServletHandler.java:481)
    at org.seleniumhq.jetty9.server.session.SessionHandler.doScope (SessionHandler.java:1553)
    at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope (ScopedHandler.java:166)
    at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope (ContextHandler.java:1130)
    at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle (ScopedHandler.java:141)
    at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle (HandlerWrapper.java:132)
    at org.seleniumhq.jetty9.server.Server.handle (Server.java:564)
    at org.seleniumhq.jetty9.server.HttpChannel.handle (HttpChannel.java:320)
    at org.seleniumhq.jetty9.server.HttpConnection.onFillable (HttpConnection.java:251)
    at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded (AbstractConnection.java:279)
    at org.seleniumhq.jetty9.io.FillInterest.fillable (FillInterest.java:112)
    at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run (ChannelEndPoint.java:124)
    at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred (Invocable.java:122)
    at org.seleniumhq.jetty9.util.thread.strategy.ExecutingExecutionStrategy.invoke (ExecutingExecutionStrategy.java:58)
    at org.seleniumhq.jetty9.util.thread.strategy.ExecuteProduceConsume.produceConsume (ExecuteProduceConsume.java:201)
    at org.seleniumhq.jetty9.util.thread.strategy.ExecuteProduceConsume.run (ExecuteProduceConsume.java:133)
    at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:672)
    at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run (QueuedThreadPool.java:590)
    at java.lang.Thread.run (Thread.java:745)

If I target the Selenium Grid node instead of the hub, then everything works as expected:

In [7]: driver = Remote(command_executor='http://localhost:5555/wd/hub', desired_capabilities={'browserName': 'firefox'})

In [8]: driver.capabilities
Out[8]: 
{'acceptInsecureCerts': False,
 'browserName': 'firefox',
 'browserVersion': '54.0',
 'cssSelectorsEnabled': True,
 'javascriptEnabled': True,
 'moz:accessibilityChecks': False,
 'moz:processID': 76207.0,
 'moz:profile': '/var/folders/3y/wrsgzz095jb2dg7vk9wnd42r0000gn/T/rust_mozprofile.QmNse4EoshqM',
 'pageLoadStrategy': 'normal',
 'platform': 'ANY',
 'platformName': 'darwin',
 'platformVersion': '16.6.0',
 'rotatable': False,
 'specificationLevel': 0.0,
 'takesScreenshot': True,
 'timeouts': {'implicit': 0.0, 'pageLoad': 300000.0, 'script': 30000.0},
 'webdriver.remote.sessionid': '3398f0b3-604f-1e46-8f22-ba9cbbe71b24'}

To reiterate, the -enablePassThrough appears to have no impact. I have tried every combination of adding it to both the hub and node command line arguments.

Note that even running the hub with -debug I see no trace of the incoming new session request in the console.

This has been fixed. Looked like an NPE crept in when attempting to pull desired capabilities from the capabilities blob.

I can confirm that using latest (fb6c35ed4974adc2c2f8308ee9d78fc4f6f3004a) works with or without the -enablePassThrough

I can also confirm that adding -enablePassThrough to the node arguments fixes the UnsupportedCommandException with mouseMoveTo. Note that without this command line option, an exception such as the following is raised in Python:

WebDriverException: Message: mouseMoveTo
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'XXXXX', ip: 'XXXXX', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.5', java.version: '1.8.0_102'
Driver info: driver.version: RemoteWebDriver
Stacktrace:
    at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode (AbstractHttpCommandCodec.java:222)
    at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode (AbstractHttpCommandCodec.java:119)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute (HttpCommandExecutor.java:158)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute (DriverCommandExecutor.java:82)
    at org.openqa.selenium.remote.RemoteWebDriver.execute (RemoteWebDriver.java:637)
    at org.openqa.selenium.remote.RemoteExecuteMethod.execute (RemoteExecuteMethod.java:35)
    at org.openqa.selenium.remote.RemoteMouse.mouseMove (RemoteMouse.java:89)
    at org.openqa.selenium.support.events.internal.EventFiringMouse.mouseMove (EventFiringMouse.java:58)
    at org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation.call (MouseMoveToLocation.java:59)
    at org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation.call (MouseMoveToLocation.java:32)
    at org.openqa.selenium.remote.server.handler.WebDriverHandler.handle (WebDriverHandler.java:41)
    at org.openqa.selenium.remote.server.rest.ResultConfig.handle (ResultConfig.java:111)
    at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest (JsonHttpCommandHandler.java:192)
    at org.openqa.selenium.remote.server.DriverServlet.lambda$handleRequest$0 (DriverServlet.java:261)
    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)

Does it make sense to mention the -enablePassThrough option within the message when w3c commands are sent to the server when this option is not set?

I have built selenium-standalone-server, support:package and webdriver:package from master, imported the nuget packages into my test app and am running the selenium-standalone-server on the grid and nodes (edit... with -enablePassThrough and geckodriver 17.0), however I'm still getting a NotImplementedException for mouseMoveTo for Firefox;

Message: System.NotImplementedException : mouseMoveTo
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'xxxx', ip: 'xxxx', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver

Is there more to be done for the c# bindings?

@matthew-horrocks I have just successfully been able to perform a drag-and-drop test using Firefox 54, tip-of-tree Java Selenium standalone server, and the latest .NET bindings with geckodriver 0.17, so I can confirm it's not globally broken for .NET.

Thanks @jimevans I'll take a look at my environment.

Hi @davehunt . Can you please tell me how to pass -enablePassThrough parameter while creating a node? I get error "Unknown option". Please help.

@forTestingSites you'd need to use a version of the server built from master, as 3.5 has not yet been released.

When will 3.5 be released? Or is there a site I can watch that will list expected release dates?

Thank you @KirillSokolovsky.

When I compiled the code, I got the following error (I used 'go.bat' in the
source directory
without any arguments, and not modifying any other file in the directory).

.

D:\Selenium\Selenium-3.4.0-WA\selenium-master>go
(in D:/Selenium/Selenium-3.4.0-WA/selenium-master)
Scanning deps
Writing build/javascript/deps.js
Jul 11, 2017 8:38:58 AM
org.apache.http.client.protocol.ResponseProcessCookies p
rocessCookies
WARNING: Invalid cookie header: "Set-Cookie: logged_in=no; domain=.
github.com; p
ath=/; expires=Sat, 11 Jul 2037 03:08:59 -0000; secure; HttpOnly". Invalid
'expi
res' attribute: Sat, 11 Jul 2037 03:08:59 -0000
python
D:/Selenium/Selenium-3.4.0-WA/selenium-master/buck-out/crazy-fun/65874cbc
58fab1746c2e7d15ea7c2f545fb0df38/buck.pex kill
Traceback (most recent call last):
File
"D:\Selenium\Selenium-3.4.0-WA\selenium-master\buck-out\crazy-fun\65874cb
c58fab1746c2e7d15ea7c2f545fb0df38\buck.pex.bootstrap_pex\pex.py", line
320, in
execute
File
"D:\Selenium\Selenium-3.4.0-WA\selenium-master\buck-out\crazy-fun\65874cb
c58fab1746c2e7d15ea7c2f545fb0df38\buck.pex.bootstrap_pex\pex.py", line
253, in
_wrap_coverage
File
"D:\Selenium\Selenium-3.4.0-WA\selenium-master\buck-out\crazy-fun\65874cb
c58fab1746c2e7d15ea7c2f545fb0df38\buck.pex.bootstrap_pex\pex.py", line
285, in
_wrap_profiling
File
"D:\Selenium\Selenium-3.4.0-WA\selenium-master\buck-out\crazy-fun\65874cb
c58fab1746c2e7d15ea7c2f545fb0df38\buck.pex.bootstrap_pex\pex.py", line
363, in
_execute
File
"D:\Selenium\Selenium-3.4.0-WA\selenium-master\buck-out\crazy-fun\65874cb
c58fab1746c2e7d15ea7c2f545fb0df38\buck.pex.bootstrap_pex\pex.py", line
421, in
execute_entry
File
"D:\Selenium\Selenium-3.4.0-WA\selenium-master\buck-out\crazy-fun\65874cb
c58fab1746c2e7d15ea7c2f545fb0df38\buck.pex.bootstrap_pex\pex.py", line
426, in
execute_module
File "D:\Python\lib\runpy.py", line 199, in run_module
return _run_code(code, {}, init_globals, run_name, mod_spec)
File "D:\Python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File
"D:\Selenium\Selenium-3.4.0-WA\selenium-master\buck-out\crazy-fun\65874cb
c58fab1746c2e7d15ea7c2f545fb0df38\buck.pex\programs\buck.py", line 8, in
>
ImportError: No module named 'buck_tool'
go aborted!
Command failed with status (1): [python
D:/Selenium/Selenium-3.4.0-WA/selen...]

(See full trace by running task with --trace)

D:\Selenium\Selenium-3.4.0-WA\selenium-master>


It looks like a Python - Buck dependency problem. Has anyone seen this
before?
I could not make progress. Can someone please tell me how to resolve this?

Thanks,
Venkat.

On Thu, Jun 1, 2017 at 4:23 PM, KirillSokolovsky notifications@github.com
wrote:

Hello @VenkatArchitect https://github.com/venkatarchitect

Can some please provide me the complete workaround and
the detailed steps to make it work?

I've discovered following solution for .Net and tried to adapt it for
Python

  1. Download/Fork etc. Selenium 3.4.0 sources from git
  2. Open sources in any Python IDE or using any preferred by you way to
    do following:
    2.1. Found corresponding line in sources using this code line link
    https://github.com/SeleniumHQ/selenium/blob/master/py/selenium/webdriver/remote/webdriver.py#L186
    2.2. change this code

parameters = {"capabilities": w3c_caps,
"desiredCapabilities": capabilities}

to following code
parameters = {"desiredCapabilities": capabilities}
2.3. Compile sources
2.4. Use compiled lib in your project

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/SeleniumHQ/selenium/issues/3808#issuecomment-305459509,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMdHN81dcbnS9R858hGe5KA9QbuOBtnmks5r_phFgaJpZM4M5en1
.

--
Did you know that you can plant trees just by
using http://www.ecosia.org as your search
engine? It's that simple. Check the website for
more details and help protect our environment
and the Earth!

I am unable perform actions on firefox browser. Below is the error I am encountering.

org.openqa.selenium.InvalidArgumentException: Could not find webelement key
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'DESKTOP-0P5GG72', ip: '192.168.1.204', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=C:\Users\Swathi\AppData\Local\Temp\rust_mozprofile.mwJ4upr1Hsx4, rotatable=false, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0.0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=54.0.1, platformVersion=10.0, moz:processID=14900.0, browserName=firefox, javascriptEnabled=true, platformName=windows_nt}]
Session ID: c0f94bbb-e3de-4b66-a307-b700a29fc5f3
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:150)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:115)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:45)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at org.openqa.selenium.remote.RemoteWebDriver.perform(RemoteWebDriver.java:703)
at org.openqa.selenium.interactions.Actions$BuiltAction.perform(Actions.java:631)
at org.openqa.selenium.interactions.Actions.perform(Actions.java:593)
at PageFactory.Workflow.selectSartErrand(Workflow.java:61)
at Tests.TC.loginToApplication(TC.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

@SP5887 Raise the new ticket for that.

Should be fixed in version 3.5, please reopen the issue if it's not true.

Not working for me in version 3.5. I had to downgrade to v3.3

@cristiansw "Not working" is a zero info message. What browser, what capabilities, what error appears?

v3.5.1 fixes the issue for C#/Chrome/Windows
@cristiansw, have you upgraded both your project's Selenium and the selenium-server-standalone jar?

Thanks

@fatdh thanks for the update, I've just upgraded to 3.5.1, however, I'm using selenium grid running on docker and the docker image is still using selenium-server-standalone 3.4.0

@barancev Let's backtrack a little bit.. I wouldn't say that

Should be fixed in version 3.5

is very informing.. was it fixed or not? I was just trying to help & signal that the original issue might need to be reopened.

Would it possible to get the version 3.5 of the java selenium libraries on the central maven repository?
Thanks!

I can verify that the 3.5.1 fixed the issue for me.(C#) I'm also using Selenium Grid v3.4.0
Thanks.

Should this be fixed in the standalone mode as well?

I'm getting the following (using FF54 and geckodriver 0.18.0):

selenium.common.exceptions.WebDriverException: Message: mouseMoveTo
Build info: version: '3.5.0', revision: '8def36e068', time: '2017-08-10T23:00:22.093Z'
System info: host: 'myhost', ip: '130.194.77.215', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_101'
Driver info: driver.version: unknown
Stacktrace:
    at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode (AbstractHttpCommandCodec.java:222)
    at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode (AbstractHttpCommandCodec.java:119)
    at org.openqa.selenium.remote.server.ProtocolConverter.handle (ProtocolConverter.java:72)
    at org.openqa.selenium.remote.server.ServicedSession.execute (ServicedSession.java:81)
    at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0 (WebDriverServlet.java:231)
    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)

Sorry, my fault, it works now :)

I think we can close this issue.

FYI: version 3.5.1 is available in maven central

@mpgo13

Sorry, my fault, it works now :)

Can you share what your fix is/was? Experiencing the same issue with v3.5.2 and geckodriver v0.18 and hoped that v3.5.0 should fix this.

edit:
note to future self: read comments above
note to other readers: pass -enablePassThrough to the standalone

Can you share what your fix is/was? Experiencing the same issue with v3.5.2 and geckodriver v0.18 and hoped that v3.5.0 should fix this.

I was upgrading the server while still using old python selenium.

I was redirected to this issue report by:
"UnsupportedCommandException mouseMoveTo with 3.4 on firefox with geckodriver 0.16.1 #4008"

FF 52.3.0
geckodriver 18
Selenium 3.5.3

I am not using a standalone, so how can I pass "-enablePassthrough"? I'm just creating FirefoxDriver(), and specifying the location of the geckodriver via System.setProperty("webdriver.gecko.driver", ...) in Java.
I don't want to use "legacy" mode (which is not supported in FF55+, right?), but I also don't want to have to switch to RemoteWebDriver.

Is using FirefoxDriver + gecko a supported path forward?

FYI, -enablePassThrough requires a boolean argument and is enabled by default since v3.5.0. On my side, I had to set -enablePassThrough false on my nodes (same with standalone) to get things working with FF55+ & geckodriver 18.

Yeah, I'm aware it requires an argument. I was trying to figure where to apply that option, since I'm not running any nodes, nor a standalone Selenium server. I'm launching WebDriver by calling new FirefoxDriver() in Java, and then driver.get() on a URL. Perhaps the redirect from issue #4008 was incorrect, as this issue refers to "Grid" and I'm not using that, nor standalone WebDriver.

Is the Pass Through Mode the way going forward for supporting W3C compliant webdrivers in the standalone server or is it planned to make it working also without Pass Through Mode?

All modes should work.

On Fri, Sep 15, 2017 at 5:16 PM, Philip Lonsing notifications@github.com
wrote:

Is the Pass Through Mode the way going forward for supporting W3C
webdrivers in the standalone server or is it planned to make it working
also without Pass Through Mode?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/SeleniumHQ/selenium/issues/3808#issuecomment-329829129,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABuRX85zXmJcXyGuPE5clnwh67wCKhLks5siqLOgaJpZM4M5en1
.

Issue still reproduces for me (Ruby v2.3.3). I'm using Selenium Grid v3.3.1 running on docker and selenium-webdriver v3.5.2 on local machine.

the error is:

undefined method `capabilities' for nil:NilClass (NoMethodError)
/Users/odachka/.rvm/gems/ruby-2.3.3/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/remote/w3c/capabilities.rb:154:in `from_oss'
/Users/odachka/.rvm/gems/ruby-2.3.3/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/remote/bridge.rb:183:in `merged_capabilities'
/Users/odachka/.rvm/gems/ruby-2.3.3/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/remote/bridge.rb:103:in `create_session'
/Users/odachka/.rvm/gems/ruby-2.3.3/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/remote/bridge.rb:54:in `handshake'
/Users/odachka/.rvm/gems/ruby-2.3.3/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/remote/driver.rb:39:in `initialize'
/Users/odachka/.rvm/gems/ruby-2.3.3/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/common/driver.rb:58:in `new'
/Users/odachka/.rvm/gems/ruby-2.3.3/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/common/driver.rb:58:in `for'
/Users/odachka/.rvm/gems/ruby-2.3.3/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver.rb:86:in `for'
/Users/odachka/aytm/aytmRegressionTests/pvRegressionTests/features/support/hooks.rb:12:in `<top (required)>'

@DaryaOrlova that's because you're using grid v3.3.1, this was fixed in the grid code not the ruby gem

So we've been running into this at work with the C# bindings. By making these changes starting at line 1108 in RemoteWebDriver.cs we are now capable of using desired capabilities as worked prior to the w3c changes. https://gist.github.com/tkueck/178eb16058c9e3b240107dcc2c4cb2f3

Was this page helpful?
0 / 5 - 0 ratings