SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.5k stars 8.15k forks source link

Selenium Grid + IE11 #7258

Closed lpanger closed 4 years ago

lpanger commented 5 years ago

šŸ› Bug Report

When using IEDriver on selenium grid, the response is missing the status property. Works when run locally using same versions.

To Reproduce

Webdriver 3.141.59 IE Driver 3.141.59 (tried both 32 and 64bit) Nightwatch 1.1.11

I am unable to run nightwatch against my selenium grid using IE11. FF and Chrome work fine. In verbose mode I noticed the response from the server was missing the status property:

   Request POST http://x.x.x.x:4444 /wd/hub/session/95853095-1a54-477d-b54c-fff8a31ba969/elements

   { using: 'css selector', value: '#username' }

   Response 200 POST http://x.x.x.x:4444/wd/hub/session/95853095-1a54-477d-b54c-fff8a31ba969/elements (275ms)

   { value:
      [ { 'element-6066-11e4-a52e-4f735466cecf': '4fa461d3-3821-492f-8412-fa6007445eb2' } ] }

When I run it locally, the response has status: 0 as expected.

Expected behavior

Response will include status property

Environment

OS: Client is Windows 10, Selenium grid is running on Windows 2016 Server Browser: Internet Explorer Browser version: 11.576.14393.0 Browser Driver version: IEDriver 3.141.59 Language Bindings version: Javascript (nightwatch 1.1.11) Selenium Grid version (if applicable): 3.141.59

jimevans commented 5 years ago

The W3C WebDriver Specification indicates that there should be no status property on responses. Since the IE driver implements the spec, it does not return a status property in its JSON responses. Itā€™s mildly concerning that it works outside the grid with a set of language bindings that arenā€™t spec-compliant. I will check that when I get back to a place where I can look carefully at the code; it should not work locally in that case. At any rate, the IE driver will not be changing to add a status property to its responses.

@shs96c, @barancev Is grid doing protocol translation in this case? Is there a potential bug there if so?

lpanger commented 5 years ago

FYI, this is what it looks like when I run it locally


Request POST  /wd/hub/session/cddec38b-f6c1-4932-85da-cbef1be44664/elements
   { using: 'css selector', value: '#username' }

   Response 200 POST /wd/hub/session/cddec38b-f6c1-4932-85da-cbef1be44664/elements (106ms)

   { state: 'success',
     sessionId: null,
     value:
      [ { 'element-6066-11e4-a52e-4f735466cecf': '435e6408-0c5c-4bb3-a090-cb09a768a396' } ],
     status: 0 }
jimevans commented 5 years ago

@lpanger I'm sorry, but that's not what I see when I run directly against the IE driver using the .NET bindings. I simply see the value property in the response. Moreover, looking at the IE driver source code, the sources don't add anything other than a value property when sending back across the wire. I don't know where the extra information is coming from.

lpanger commented 5 years ago

To strip this down even further I ran just selenium standalone using java -jar selenium-standalone-3.141.59.jar

Then I created a new internet explorer session from the selenium console gui.

This started an IE11 browser instance which I navigated to my test URL and then using the GUID from the console gui I did a GET call for an element.

I did the same thing with selenium grid setup locally and the response was simply the value property.

Using the same node I went through the steps above to create a new session and this new session has the status property. Could it be the way the grid is starting sessions in the IEDriver? Looking at the capabilities of the sessions the only difference is the one I created manually has a webdriver.remote.sessionid property.

diemol commented 4 years ago

@lpanger Grid 3.x is not under development anymore, and since the code is not present in the tree anymore, we cannot check if this is a bug in Grid or not. However, we are currently working on Grid 4, so could you please try again and see if the behavior is the same one? If so, please provide detailed steps (with code as well).

How to start Grid 4 (alphas)

java -jar selenium-server-4.0.0-alpha-5.jar hub
java -jar selenium-server-4.0.0-alpha-5.jar node

It can be downloaded from https://www.selenium.dev/downloads/

diemol commented 4 years ago

Closing as the issue went stale.