SeleniumHQ / selenium

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

selenuim server node 3.14.0 failed to start new session for Edge #6464

Closed nbquestnb closed 3 years ago

nbquestnb commented 5 years ago

selenium server node failed to start new session for edge

OS: Windows 10

Selenium Version: 3.14.0

Browser: Edge

Browser Version:
44.17763.1.0 WebDriver version: 10.0.17763

Expected Behavior -

New session starts for edge browser.

Actual Behavior -

Node fails to create new session with error in log:

[04:37:59.452] - Listening on http://127.0.0.1:33791/ 
[04:37:59.452] - Listening on http://[::1]:33791/ 
[04:37:59.936] - Invalid capabilities 
The following JSON wire protocol command endpoint is not allowed when server is running in W3C mode.
GET /shutdown

Steps to reproduce -

1) Run selenium-standalone-server.jar on VM1 java -jar selenium-server-standalone-3.14.0.jar -debug -role hub 2) Run selenium-standalone-server.jar on VM2 as Edge node java "-Dwebdriver.edge.driver=C://Windows/System32/MicrosoftWebDriver.exe" "-Dwebdriver.edge.driver=C://selenium/driverlog" -jar selenium-server-standalone-3.14.0.jar -debuf -role node -nodeConfig edge_node_config.json edge_node_config.json contents:

{
  "browserTimeout": 0,
  "capabilities": [
    {
      "browserName": "MicrosoftEdge",
      "browserVersion": "44.17743.1.0",
      "maxInstances": 1,
      "plaftormName": "win10",
      "platform": "WIN10",
      "platformName": "WIN10",
      "seleniumProtocol": "WebDriver"
    }
  ],
  "custom": {
  },
  "debug": true,
  "downPollingLimit": 2,
  "enablePlatformVerification": false,
  "host": "192.168.1.36",
  "hubHost": "192.168.1.42",
  "hubPort": 4444,
  "id": "http://192.168.1.36:7890",
  "maxSession": 5,
  "nodePolling": 5000,
  "nodeStatusCheckTimeout": 5000,
  "port": 7890,
  "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
  "register": true,
  "registerCycle": 5000,
  "remoteHost": "http://192.168.1.36:7890",
  "role": "node",
  "servlets": [
  ],
  "timeout": 1800,
  "unregisterIfStillDownAfter": 60000,
  "withoutServlets": [
  ]
}

So this probably related to one of last changes which supported --jwp & --w3c args for MicrosoftWebDriver, but if I manually add --jwp flag to executable path it will fail create instance of EdgeDriverService. Is there any way to strictly define which arguments should be passed to executable of EdgeDriver?

nbquestnb commented 5 years ago

Forgot to mention that i'm using Visual Studio to run tests. Here is the capabilities i'm using:

EdgeOptions edgeOptions = new EdgeOptions();
edgeOptions.PageLoadStrategy = PageLoadStrategy.Default;
edgeOptions.PlatformName = "win10";
edgeOptions.AddAdditionalCapability("platform","WIN10");
edgeOptions.AddAdditionalCapability("seleniumProtocol","WebDriver");
edgeOptions.AddAdditionalCapability("maxInstances",1);
edgeOptions.BrowserVersion = "44.17743.1.0";
desiredCapabilities = edgeOptions.ToCapabilities();
driver = new RemoteWebDriver(seleniumServerUri, desiredCapabilities);
gr8buddy commented 5 years ago

Having similar issue when I run my Selenium tests using VSO Environment details Windows version : 1809 OS Build : 17763.1 Edge version : 44.17763.1.0

Initialization settings for test using (var driverService = OpenQA.Selenium.Edge.EdgeDriverService.CreateDefaultService())

         using (var instance = new OpenQA.Selenium.Edge.EdgeDriver(driverService))
        {
            instance.Navigate().GoToUrl("<<Url removed>>");

Exception details OpenQA.Selenium.WebDriverException HResult=0x80131500 Message=A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:32577/session. The status of the exception was ReceiveFailure, and the message was: The underlying connection was closed: An unexpected error occurred on a receive. Source=WebDriver StackTrace: at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo) at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeDriverService service, EdgeOptions options) at OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeDriverService service) at ReleaseUIAutomatedTest.ReleaseUITests.A1_BasicSubmit() in ... Inner Exception 1: WebException: The underlying connection was closed: An unexpected error occurred on a receive.

Inner Exception 2: IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

Inner Exception 3: SocketException: An existing connection was forcibly closed by the remote host

nbquestnb commented 5 years ago

@barancev Hello, I'm sorry that i misled you with my comment but the actual issue is not in the dotnet part of the selenium. The actual error happens when java node tries to run driver executable. I created PR that might fix the issue. https://github.com/SeleniumHQ/selenium/pull/6485

barancev commented 5 years ago

@nbquestnb Please run the node with -debug option, reproduce the issue and attach the console log here. Session initialization should work without need to set any system properties. We must be sure that the issue actually related to protocol version mismatch before merging this PR.

nbquestnb commented 5 years ago

@barancev Here you go

selenium run script

java "-Dwebdriver.edge.driver=C://Windows/System32/MicrosoftWebDriver.exe" "-Dwebdriver.edge.logfile=C:/selenium/driverlog" "-Dwebdriver.edge.verboseLogging=true" -jar selenium-server-standalone-3.14.0.jar -debug -role node -nodeConfig edge_node_config.json

node logfile

java "-Dwebdriver.edge.driver=C://Windows/System32/MicrosoftWebDriver.exe" "-Dwebdriver.edge.logfile=C:/selenium/driverlog" "-Dwebdriver.edge.verboseLogging=true" -jar selenium-server-standalone-3.14.0.jar -debug -role node -nodeConfig edge_node_config.json 04:24:28.915 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.14.0', revision: 'aacccce0' 04:24:28.930 INFO [GridLauncherV3$3.launch] - Launching a Selenium Grid node on port 7890 2018-10-06 04:24:29.351:INFO::main: Logging initialized @1123ms to org.seleniumhq.jetty9.util.log.StdErrLog 04:24:29.663 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 7890 04:24:29.663 INFO [GridLauncherV3$3.launch] - Selenium Grid node is up and ready to register to the hub 04:24:29.741 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms. 04:24:29.741 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://192.168.1.42:4444/grid/register 04:24:31.284 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use 04:28:15.719 INFO [ActiveSessionFactory.apply] - Capabilities are: { "browserName": "MicrosoftEdge", "browserVersion": "44.17743.1.0", "maxInstances": 1, "platform": "WIN10", "platformName": "win10", "seleniumProtocol": "WebDriver" } 04:28:15.735 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.edge.EdgeDriverService) 04:28:17.235 INFO [ServicedSession$Factory.apply] - The specified arguments passed to the command are invalid. Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z' System info: host: 'EDGEDRIVER', ip: '192.168.1.36', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: unknown remote stacktrace: org.openqa.selenium.InvalidArgumentException: The specified arguments passed to the command are invalid. Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z' System info: host: 'EDGEDRIVER', ip: '192.168.1.36', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: unknown remote stacktrace: 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.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:125) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73) at org.openqa.selenium.remote.server.RemoteSession$Factory.performHandshake(RemoteSession.java:145) at org.openqa.selenium.remote.server.ServicedSession$Factory.apply(ServicedSession.java:160) at org.openqa.selenium.remote.server.ActiveSessionFactory.lambda$apply$12(ActiveSessionFactory.java:177) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$11$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.ActiveSessionFactory.apply(ActiveSessionFactory.java:180) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$null$2(NewSessionPipeline.java:65) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.Collections$2.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$3(NewSessionPipeline.java:68) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.DistinctOps$1$2.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.stream.Streams$StreamBuilderImpl.tryAdvance(Unknown Source) at java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.NewSessionPipeline.createNewSession(NewSessionPipeline.java:71) at org.openqa.selenium.remote.server.commandhandler.BeginSession.execute(BeginSession.java:65) at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$3(WebDriverServlet.java:250) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 04:28:17.500 INFO [ActiveSessionFactory.apply] - Capabilities are: { "browserName": "MicrosoftEdge", "browserVersion": "44.17743.1.0", "platformName": "win10" } 04:28:17.500 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.edge.EdgeDriverService) 04:28:18.063 INFO [ServicedSession$Factory.apply] - The specified arguments passed to the command are invalid. Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z' System info: host: 'EDGEDRIVER', ip: '192.168.1.36', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: unknown remote stacktrace: org.openqa.selenium.InvalidArgumentException: The specified arguments passed to the command are invalid. Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z' System info: host: 'EDGEDRIVER', ip: '192.168.1.36', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: unknown remote stacktrace: 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.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:125) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73) at org.openqa.selenium.remote.server.RemoteSession$Factory.performHandshake(RemoteSession.java:145) at org.openqa.selenium.remote.server.ServicedSession$Factory.apply(ServicedSession.java:160) at org.openqa.selenium.remote.server.ActiveSessionFactory.lambda$apply$12(ActiveSessionFactory.java:177) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$11$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.ActiveSessionFactory.apply(ActiveSessionFactory.java:180) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$null$2(NewSessionPipeline.java:65) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.Collections$2.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$3(NewSessionPipeline.java:68) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.DistinctOps$1$2.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(Unknown Source) at java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.NewSessionPipeline.createNewSession(NewSessionPipeline.java:71) at org.openqa.selenium.remote.server.commandhandler.BeginSession.execute(BeginSession.java:65) at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$3(WebDriverServlet.java:250) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

driver executable output

[04:28:17.563] - Starting server...

[04:28:17.563] - Listening on http://127.0.0.1:8262/

[04:28:17.563] - Waiting for new request...

[04:28:18.032] - Received a request: GET http://localhost:8262/status

[04:28:18.032] -

[04:28:18.032] - Response: {"value":{"message":"WebDriver server is ready","ready":true}}

[04:28:18.032] - Waiting for new request...

[04:28:18.047] - Received a request: POST http://localhost:8262/session

[04:28:18.047] - { "desiredCapabilities": { "browserName": "MicrosoftEdge", "platformName": "win10", "browserVersion": "44.17743.1.0" }, "capabilities": { "firstMatch": [ { "browserName": "MicrosoftEdge", "browserVersion": "44.17743.1.0", "platformName": "win10" } ] } }

[04:28:18.063] - Response: {"value":{"error":"invalid argument","message":"The specified arguments passed to the command are invalid.","stacktrace":""}}

[04:28:18.063] - Invalid capabilities

[04:28:18.063] - Waiting for new request...

[04:28:18.063] - Received a request: GET http://localhost:8262/shutdown

[04:28:18.063] -

The following JSON wire protocol command endpoint is not allowed when server is running in W3C mode. GET /shutdown

[04:28:18.063] - Response: Unknown error

nbquestnb commented 5 years ago

@barancev with my fix applied i was able to run the session

rgoerner commented 5 years ago

@barancev , @nbquestnb

Is there need to fix selenium release, or how can we fix 3.14 ? downgrade to 3.13 or what do you suggest?

rommy1204 commented 5 years ago

@barancev do you have any updates for this topic? Getting exactly the same error

dylanlive commented 5 years ago

I also started seeing this immediately when I upgraded from Windows build 1803 to 1809.

Version Information

Windows 10, Build 1809 Selenium 3.141.5 (Grid) Edge WebDriver Version: 10.0.17763.1 (Default bundled with Windows 1809) Client: WebdriverIO v4.14.1

Driver Log Examples

The following JSON wire protocol command endpoint is not allowed when server is running in W3C mode.
DELETE /session/D031BDFE-D27A-4ACA-A163-D9107B412B70/local_storage

The following JSON wire protocol command endpoint is not allowed when server is running in W3C mode.
GET /session/D031BDFE-D27A-4ACA-A163-D9107B412B70/window/current/size

The following JSON wire protocol command endpoint is not allowed when server is running in W3C mode.
GET /shutdown

Client Log Examples (WebdriverIO)

[12:30:49]  COMMAND DELETE   "/wd/hub/session/D031BDFE-D27A-4ACA-A163-D9107B412B70/local_storage"
[12:30:49]  DATA        {}
Dec 11 2018 12:30:49 - Failed to delete localStorage in MicrosoftEdge: Error: Unknown error

[12:30:49]  COMMAND GET      "/wd/hub/session/D031BDFE-D27A-4ACA-A163-D9107B412B70/window/current/size"
[12:30:49]  DATA        {}
Dec 11 2018 12:30:49 - Could not set viewport size: Error: Unknown error

Other Details

Grid Up And Running (including installation of MicrosoftWebDriver) with:

DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0
java -jar selenium-server-standalone-3.141.5.jar -role node -nodeConfig nodeConfig.json
thejohnjansen commented 5 years ago

Please note, that this looks like you are running JWP mode against the W3C version of the endpoints. If you want to continue to run in JWP mode, that is a capability (documented here: https://docs.microsoft.com/en-us/microsoft-edge/webdriver). If there is something else going on here, we'll need to investigate.

dylanlive commented 5 years ago

Similar to https://github.com/SeleniumHQ/selenium/pull/6485, I forked the repo and within EdgeDriverService.java I added:

argsBuilder.add("--jwp");

to launch MicrosoftWebdriver in JWP Mode.

This resolved the issue for me.

Is it the webdriverio client bindings that don't yet support the W3C Commands?

jimevans commented 5 years ago

@dylanlive That’s almost assuredly the case.

dylanlive commented 5 years ago

Alrighty - thanks everyone. I think in summary I'm understanding:

@barancev As an actionable item, is it reasonable to support in the desired capabilities to launch Edge Webdriver in a certain mode (w3c/jwp), similar to the Firefox marionette capability?

I see https://github.com/SeleniumHQ/selenium/pull/6485 uses a system environment variable to set this. It would be nice if this could be dynamic so that from the Selenium Grid perspective, if a client is still using json protocol, it can request the jwp mode of MicrosoftWebdriver.

dylanlive commented 5 years ago

Further detail:

I spoke with the WebdriverIO Community, which informed me Execute by default will send in json wire protocol (/execute), but if it receives back Unknown Command, will retry with the W3C command (/execute/sync). https://github.com/webdriverio-boneyard/v4/blob/767a0cb7796c0635034bfe991fa851ff6f711ff1/lib/protocol/execute.js#L63-L65

Unfortunately, when receiving a JWP command in W3C mode, it appears MicrosoftWebdriver returns back 500 - Unknown Error, instead of 404 - Unknown command. Thus, Webdriverio doesn't seem to retry.

I've opened a bug report for this on the Microsoft side: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/19917561/

cc @thejohnjansen

presidenten commented 5 years ago

@dylanlive

Similar to #6485, I forked the repo and within EdgeDriverService.java I added:

argsBuilder.add("--jwp");

to launch MicrosoftWebdriver in JWP Mode.

This resolved the issue for me.

Is it the webdriverio client bindings that don't yet support the W3C Commands?

Is there someway to add the --jwp argument without forking and rebuilding selenium?

edgramirez commented 5 years ago

Hello I am having the same issue running a remote script.

In my Windows 10 Pro Education, I am running these 2 commands in separate cmd windows: java -jar selenium-server-standalone-3.141.59.jar -port 4545 msedgedriver.exe (default port 9515)

In my test machine (Linux ubuntu 18 - Python 3.6.7 - Selenium 3.141.0) I am running my python script:

      from selenium import webdriver
      remote_selenium = 'http://10.216.139.12:4545/wd/hub'
      targe_url = 'http://10.216.139.116'
      # This next lines are what generate the failure 
      my_driver = webdriver.Remote(
                    command_executor=remote_selenium,
                    desired_capabilities=webdriver.DesiredCapabilities.EDGE
                    )
      .....
      my_drivers.get(targe_url)

Description of Windows 10:

Description of Linux testter machine:

selenium_server_standalone_3_141_59_jar_log.txt

thejohnjansen commented 5 years ago

I'm curious about why you are running in -jwp mode still. Is there functionality that is necessary for you in JWP that w3c does not provide?

I put this note in the bug report:

I have assigned this issue to a developer to take a look. We are hesitant to take changes to the driver given our move to Chromium and being focused on that; however, if the fix is not very risky, we’ll take it.

edgramirez commented 5 years ago

Hello John, thank you very much for your quick response, Sorry, maybe i express my problem incorrectly because I am not using Chome but Edge, my tests with Chrome, and Firefox pass correctly is just Edge the one that fails about the -jwp and --w3c modes I just added the parameter --w3c to my msedgedriver call but still have the same error.

What i see in the windows10 at the time I run my test, is that the Edge browser opens one time and the close and then opens again and the stays open but the window where i run the selenuin-server-standalone shows a failed as well as my run in the Linux machine.

LINUX - My code executed from an external Linux machine ran against the windows10 machine ( 10.216.139.12 ):

from selenium import webdriver webdriver.Remote(command_executor='http://*10.216.139.12*:4545/wd/hub', desired_capabilities=webdriver.DesiredCapabilities.EDGE)

LINUX - My logs of the run:

Connected to pydev debugger (build 181.4203.547) Traceback (most recent call last): File "/home/edgar/Downloads/pycharm-2017.2.3/helpers/pydev/pydevd.py", line 1664, in main() File "/home/edgar/Downloads/pycharm-2017.2.3/helpers/pydev/pydevd.py", line 1658, in main globals = debugger.run(setup['file'], None, None, is_module) File "/home/edgar/Downloads/pycharm-2017.2.3/helpers/pydev/pydevd.py", line 1068, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/home/edgar/Downloads/pycharm-2017.2.3/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/edgar/qa_pata/python/tests/aos/ui/aosUI/Example.py", line 63, in drivers.append(webdriver.Remote(command_executor=remote_selenium, desired_capabilities=webdriver.DesiredCapabilities.EDGE)) File "/home/edgar/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "/home/edgar/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/home/edgar/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/home/edgar/.local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: Unable to create session from { "desiredCapabilities": { "browserName": "MicrosoftEdge", "version": "", "platform": "WINDOWS" }, "capabilities": { "firstMatch": [ { "browserName": "MicrosoftEdge", "platformName": "windows" } ] } } Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'LAPTOP-OF6T04SI', ip: '10.216.139.12', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_211' Driver info: driver.version: unknown Stacktrace: at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$null$4 (NewSessionPipeline.java:76) at java.util.Optional.orElseThrow (None:-1) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$5 (NewSessionPipeline.java:75) at java.util.Optional.orElseGet (None:-1) at org.openqa.selenium.remote.server.NewSessionPipeline.createNewSession (NewSessionPipeline.java:73) at org.openqa.selenium.remote.server.commandhandler.BeginSession.execute (BeginSession.java:65) at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0 (WebDriverServlet.java:235) at java.util.concurrent.Executors$RunnableAdapter.call (None:-1) at java.util.concurrent.FutureTask.run (None:-1) at java.util.concurrent.ThreadPoolExecutor.runWorker (None:-1) at java.util.concurrent.ThreadPoolExecutor$Worker.run (None:-1) at java.lang.Thread.run (None:-1)

Windows10 - My msedgedriver call:

C:\Aruba\Automation\Webdrivers>C:\Aruba\Automation\Webdrivers\msedgedriver.exe --w3c Starting MSEdgeDriver 75.0.137.0 (2f3d804577162143ec43b15d92f1ab4db9de84cd) on port 9515 Only local connections are allowed. Please protect ports used by the WebDriver and related test frameworks to prevent access by malicious code.

Windows10 - My selenium-server-standalone call and its log when I execute the test: C:\Users\auto\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup>cd C:\Aruba\Automation

C:\Aruba\Automation>java -jar selenium-server-standalone-3.141.59.jar -port 4545 -debug 11:42:30.407 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358 11:42:30.751 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4545 2019-05-17 11:42:30.938:INFO::main: Logging initialized @1453ms to org.seleniumhq.jetty9.util.log.StdErrLog 11:42:31.829 INFO [WebDriverServlet.] - Initialising WebDriverServlet 11:42:32.751 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4545 11:42:55.905 DEBUG [WebDriverServlet.handle] - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@404548e8 11:42:56.030 DEBUG [WebDriverServlet.lambda$handle$0] - /session: Executing POST on /session (handler: BeginSession) 11:42:56.468 INFO [ActiveSessionFactory.apply] - Capabilities are: { "browserName": "MicrosoftEdge", "platform": "WINDOWS", "version": "" } 11:42:56.483 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.edge.EdgeDriverService) 11:42:56.546 DEBUG [UrlChecker.waitUntilAvailable] - Waiting for [ http://localhost:40254/status] 11:42:56.546 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:40254/status [11:42:56.702] - Listening on http://localhost:40254/ 11:42:57.093 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:40254/status 11:42:57.093 DEBUG [HttpURLConnection.writeRequests] - sun.net.www.MessageHeader@35e6f2845 pairs: {GET /status HTTP/1.1: null}{User-Agent: Java/1.8.0_211}{Host: localhost:40254}{Accept: text/html, image/gif, image/jpeg, ; q=.2, /; q=.2}{Connection: keep-alive} 11:42:57.109 DEBUG [HttpURLConnection.getInputStream0] - sun.net.www.MessageHeader@70e47a5c5 pairs: {null: HTTP/1.1 200 OK}{Content-Type: application/json;charset=UTF-8}{Server: Microsoft-HTTPAPI/2.0}{Date: Fri, 17 May 2019 14:42:57 GMT}{Content-Length: 129} 11:43:09.367 WARN [RemoteSession$Factory.performHandshake] - Failed to connect to localhost/0:0:0:0:0:0:0:1:40254 java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:40254 at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:247) at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:165) at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257) at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135) at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) at okhttp3.RealCall.execute(RealCall.java:77) at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:103) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:105) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74) at org.openqa.selenium.grid.session.remote.RemoteSession$Factory.performHandshake(RemoteSession.java:147) at org.openqa.selenium.grid.session.remote.ServicedSession$Factory.apply(ServicedSession.java:161) at org.openqa.selenium.remote.server.ActiveSessionFactory.lambda$apply$12(ActiveSessionFactory.java:180) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$11$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.ActiveSessionFactory.apply(ActiveSessionFactory.java:183) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$null$2(NewSessionPipeline.java:66) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.Collections$2.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$3(NewSessionPipeline.java:69) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.DistinctOps$1$2.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.stream.Streams$StreamBuilderImpl.tryAdvance(Unknown Source) at java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.NewSessionPipeline.createNewSession(NewSessionPipeline.java:72) at org.openqa.selenium.remote.server.commandhandler.BeginSession.execute(BeginSession.java:65) at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0(WebDriverServlet.java:235) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at okhttp3.internal.platform.Platform.connectSocket(Platform.java:129) at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:245) ... 71 more 11:43:09.382 INFO [ActiveSessionFactory.apply] - Capabilities are: { "browserName": "MicrosoftEdge", "platformName": "windows" } 11:43:09.398 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.edge.EdgeDriverService) 11:43:09.429 DEBUG [UrlChecker.waitUntilAvailable] - Waiting for [ http://localhost:13486/status] 11:43:09.429 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:13486/status [11:43:09.570] - Listening on http://localhost:13486/ 11:43:09.961 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:13486/status 11:43:09.961 DEBUG [HttpURLConnection.writeRequests] - sun.net.www.MessageHeader@41de89cd5 pairs: {GET /status HTTP/1.1: null}{User-Agent: Java/1.8.0_211}{Host: localhost:13486}{Accept: text/html, image/gif, image/jpeg, ; q=.2, /; q=.2}{Connection: keep-alive} 11:43:09.961 DEBUG [HttpURLConnection.getInputStream0] - sun.net.www.MessageHeader@43ae31a05 pairs: {null: HTTP/1.1 200 OK}{Content-Type: application/json;charset=UTF-8}{Server: Microsoft-HTTPAPI/2.0}{Date: Fri, 17 May 2019 14:43:09 GMT}{Content-Length: 129} 11:43:20.554 WARN [RemoteSession$Factory.performHandshake] - Failed to connect to localhost/0:0:0:0:0:0:0:1:13486 java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:13486 at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:247) at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:165) at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257) at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135) at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) at okhttp3.RealCall.execute(RealCall.java:77) at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:103) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:105) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74) at org.openqa.selenium.grid.session.remote.RemoteSession$Factory.performHandshake(RemoteSession.java:147) at org.openqa.selenium.grid.session.remote.ServicedSession$Factory.apply(ServicedSession.java:161) at org.openqa.selenium.remote.server.ActiveSessionFactory.lambda$apply$12(ActiveSessionFactory.java:180) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$11$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.ActiveSessionFactory.apply(ActiveSessionFactory.java:183) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$null$2(NewSessionPipeline.java:66) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.Collections$2.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$3(NewSessionPipeline.java:69) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.DistinctOps$1$2.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(Unknown Source) at java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.server.NewSessionPipeline.createNewSession(NewSessionPipeline.java:72) at org.openqa.selenium.remote.server.commandhandler.BeginSession.execute(BeginSession.java:65) at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0(WebDriverServlet.java:235) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at okhttp3.internal.platform.Platform.connectSocket(Platform.java:129) at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:245) ... 71 more

thejohnjansen commented 5 years ago

Sorry for confusing you. I know you mean "Edge" browser. What I meant is that since Edge (the new Edge) is based on Chromium, any changes to the Edge you are using would actually require a servicing change. When we service, we have to be super careful about regressions, so the bar for making changes is pretty high. We have to carefully balance risk/reward.

That's why I asked why you still need to run in --jpw mode. I'm curious what the benefits are for that, rather than moving to the standards method.

cgoldberg commented 5 years ago

@edgramirez why are you running msedgedriver.exe from the command line?

edgramirez commented 5 years ago

Sorry, I am not an experience selenium user, just a week ago was assigned to automate hundred of tests that will run in windows linux and mac with as much as browsers our servers will support and so i see that we can use the selenium-server-standalone. But I am afraid still not really catching what you mean by running in --jpw mode. I actually have not requirement to run in --jpw mode so i can run in --w3c mode. The last email logs were executing using msedgedriver --w3c mode. Is it the correct way to call the --w3c mode?

Thank you very much for your clarification is really appreciated.

On Fri, May 17, 2019 at 12:48 PM John Jansen notifications@github.com wrote:

Sorry for confusing you. I know you mean "Edge" browser. What I meant is that since Edge (the new Edge) is based on Chromium, any changes to the Edge you are using would actually require a servicing change. When we service, we have to be super careful about regressions, so the bar for making changes is pretty high. We have to carefully balance risk/reward.

That's why I asked why you still need to run in --jpw mode. I'm curious what the benefits are for that, rather than moving to the standards method.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SeleniumHQ/selenium/issues/6464?email_source=notifications&email_token=ALWOWWODKWFPIFLJ4IOLRBDPV3OUXA5CNFSM4FYHWWPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVVITJA#issuecomment-493521316, or mute the thread https://github.com/notifications/unsubscribe-auth/ALWOWWJD2LD6JO3ZURF4GLLPV3OUXANCNFSM4FYHWWPA .

edgramirez commented 5 years ago

The purpose of running in the command line was to see any output that it may generate. Also my test is execute from an external linux machine not from inside the Windows machine.

My OS is: 17763.107 And the drivers options I have are the latest release 75 or 17134 (this last one not sure will recognize the Edge version i have). but any way I am trying with both drivers one at a time adding the option --w3c

presidenten commented 5 years ago

@thejohnjansen

I'm curious about why you are running in -jwp mode still. Is there functionality that is necessary for you in JWP that w3c does not provide?

I put this note in the bug report:

I have assigned this issue to a developer to take a look. We are hesitant to take changes to the driver given our move to Chromium and being focused on that; however, if the fix is not very risky, we’ll take it.

When I wanted to use the driver with Webdriver.io I could not get it to work, and got the impression that I needed jwp to make the tests run.

However it turned out I just needed the correct driver which is included in Windows since 1809. (But by then I forgot I had commented in this thread.)

Here is how I got it working:

Installation procedure: Settings - apps - manage optional features - add a feature - Microsoft webdriver

using this config:

{
  "capabilities":
  [
    {
      "browserName": "MicrosoftEdge",
      "maxInstances": 5,
      "version": "18.17763",
      "seleniumProtocol": "WebDriver"
    }
  ],
  "hubHost": "<insert-selenium-grid-hub-url-here>",
  "hubPort": 4444,
  "cleanUpCycle": 2000,
  "timeout": 30000,
  "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
  "maxSession": 1,
  "register": true,
  "registerCycle": 5000,
  "unregisterIfStillDownAfter": 10000,
  "debug": false,
  "role": "node"
}

Then add the node to the grid with this command:

java -jar "C:\selenium\selenium-server-standalone-3.141.59.jar" -role node -nodeConfig edge.json
kool79 commented 4 years ago

I found that when I pass acceptInsecureCerts = true with capabilities then Edge failed to start with message "Invalid Capabilities". (I see exactly the same log as described in "Actual behavior" of this ticket, see above) When I remove this from capabilities or when I set to 'false' then driver successfully starts end executes base commands (navigate, findBy, click)

Here microsoft says that this capability is not supported. So it can be a bug in Microsoft webdriver.

local webdriver version - 3.141.59 selenium-server-standalone-3.141.59 (remote note, I connect to it without hub ) Microsoft Edge 44.18362.387.0 Microsoft EdgeHTML 18.18362 WebDriver version -- 10.0.18362.1 :: installed as suggested by microsoft: DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0

lind-eduard commented 4 years ago

Are there any updates on this?

thejohnjansen commented 4 years ago

@lind-eduard can you elaborate what issue you are hitting?

lind-eduard commented 4 years ago

@thejohnjansen I'm currently stuck at point where Edge is started, but I see blank page and error: Console: Error: Can't connect to WebDriver. Error: Failed to create session. Unable to parse remote response: Unknown error

Please make sure Selenium Server (ChromeDriver or PhantomJS) is running and accessible Selenium logs: 12:20:34.171 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.edge.EdgeDriverService) [12:20:34.258] - Listening on http://localhost:1946/ 12:20:42.827 WARN [RemoteSession$Factory.performHandshake] - Failed to connect to localhost/0:0:0:0:0:0:0:1:1946 java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:1946 at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:247) at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:165) at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257) at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135) at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) at okhttp3.RealCall.execute(RealCall.java:77) at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:103) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:102) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74) at org.openqa.selenium.grid.session.remote.RemoteSession$Factory.performHandshake(RemoteSession.java:147) at org.openqa.selenium.grid.session.remote.ServicedSession$Factory.apply(ServicedSession.java:161) at org.openqa.selenium.remote.server.ActiveSessionFactory.lambda$apply$12(ActiveSessionFactory.java:180) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:442) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958) at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127) at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543) at org.openqa.selenium.remote.server.ActiveSessionFactory.apply(ActiveSessionFactory.java:183) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$null$2(NewSessionPipeline.java:66) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.Collections$2.tryAdvance(Collections.java:4747) at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127) at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543) at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$3(NewSessionPipeline.java:69) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.DistinctOps$1$2.accept(DistinctOps.java:174) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.stream.Streams$StreamBuilderImpl.tryAdvance(Streams.java:397) at java.base/java.util.stream.Streams$ConcatSpliterator.tryAdvance(Streams.java:720) at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127) at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543) at org.openqa.selenium.remote.server.NewSessionPipeline.createNewSession(NewSessionPipeline.java:72) at org.openqa.selenium.remote.server.commandhandler.BeginSession.execute(BeginSession.java:65) at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0(WebDriverServlet.java:235) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:830) Caused by: java.net.ConnectException: Connection refused: no further information at java.base/sun.nio.ch.Net.pollConnect(Native Method) at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:579) at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:549) at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:339) at java.base/java.net.Socket.connect(Socket.java:585) at okhttp3.internal.platform.Platform.connectSocket(Platform.java:129) at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:245) ... 71 more 12:20:42.898 INFO [ActiveSessionFactory.apply] - Capabilities are: { "acceptInsecureCerts": true, "browserName": "MicrosoftEdge" }

Since I see that browser itself is started, I suppose that problems with session starting.

thejohnjansen commented 4 years ago

Thanks for the error, @lind-eduard . Can you share the code you used to create the driver? It's possible something is missing in the java language bindings.

I also wanted to make sure you saw this: https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium?tabs=c-sharp

As well as this tool we wrote: https://github.com/microsoft/edge-selenium-tools

Both are meant to help run MSEdgeDriver using Selenium 3 or 4.

lind-eduard commented 4 years ago

@thejohnjansen Thanks for help. I found out how to set everything up

diemol commented 3 years ago

I went through the whole thread and the issue should not be relevant anymore, since all drivers work in W3C mode right now. If there is any issue while using Edge, please feel free to create a new issue with all the information required on the template.