Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switchWindow command does not work with geckodriver #1869

Closed
ajpetersons opened this issue Aug 15, 2018 · 0 comments
Closed

switchWindow command does not work with geckodriver #1869

ajpetersons opened this issue Aug 15, 2018 · 0 comments

Comments

@ajpetersons
Copy link
Contributor

I am running tests through Selenium server (both for Chrome and Firefox browsers), and in my scenario I need to switch windows. This command works in Chrome (still using JSON Wire protocol), but fails in FireFox that is using WebDriver protocol, logs:

INFO Request: POST /wd/hub/session/d133a18d-993a-413d-a1fe-3f48e715c30d/window
 - data:  {"name":"26"}
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":13}
ERROR Response 500 POST /wd/hub/session/d133a18d-993a-413d-a1fe-3f48e715c30d/window (10ms) { sessionId: null,
  state: 'invalid argument',
  hCode: 522354673,
  value:
   { additionalInformation: '\nDriver info: driver.version: unknown',
     localizedMessage:
      'Missing \'handle\' parameter\nBuild info: version: \'3.10.0\', revision: \'176b4a9\', time: \'2018-03-02T19:11:12.151Z\'\nSystem info: host: \'b35670fa3d41\', ip: \'172.17.0.2\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'4.9.87-linuxkit-aufs\', java.version: \'1.8.0_151\'\nDriver info: driver.version: unknown',
     systemInformation:
      'System info: host: \'b35670fa3d41\', ip: \'172.17.0.2\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'4.9.87-linuxkit-aufs\', java.version: \'1.8.0_151\'',
     supportUrl: null,
     cause: null,
     suppressed: [],
     message:
      'Missing \'handle\' parameter\nBuild info: version: \'3.10.0\', revision: \'176b4a9\', time: \'2018-03-02T19:11:12.151Z\'\nSystem info: host: \'b35670fa3d41\', ip: \'172.17.0.2\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'4.9.87-linuxkit-aufs\', java.version: \'1.8.0_151\'\nDriver info: driver.version: unknown',
     hCode: 1177471444,
     class: 'org.openqa.selenium.InvalidArgumentException',
     buildInformation: null },
  class: 'org.openqa.selenium.remote.Response',
  status: 61 }

WebDriver expects handle parameter to be present, but name parameter is used instead.

The logs are with Nightwatch version 0.9.19, but it has also been tested with 1.0.8.

This issue is related to Nightwatch conformance with W3C WebDriver standard, and also raised here #1456

Issue can be avoided by downgrading to Selenium 3.8.1 and disabling passthrough mode that translates JSON Wire to WebDriver. This option was removed with Selenium 3.9.0, so this option is no longer possible with newer Selenium versions (Selenium Changelog), which in turn raises new issues with not being able to use latest Selenium versions.

Sidenote: I also noticed that getLog command will not work with WebDriver protocol since such command is not included in the standard.

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

No branches or pull requests

1 participant