1

When we run the script using Microsoft Edge getting the below error :

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

What I understand is that Edge now supports W3C mode by default. Our Java binding is sending in Json wire protocol mode(JWP). How we can instruct to Microsoft WebDriver that use JWP mode instead of W3c mode

it was mentioned in the Microsoft documentation:

w3c Use W3C WebDriver protocol (default option) 17763
jwp Use JSON Wire protocol

https://docs.microsoft.com/en-us/microsoft-edge/webdriver

Could you please let me know how we can change from W3C mode to jwp mode?

TylerH
  • 19,065
  • 49
  • 65
  • 86
Sai
  • 389
  • 2
  • 15

2 Answers2

3

Another workaround is to specify an intermediate script for the Edge Driver which:

  • Invokes the actual Edge Driver executable,
  • passes all invocation parameters to it and
  • additionally adds the "jwp" parameter.

For instance, I've created a batch file edgedriver.bat with following content:

C:\Windows\System32\MicrosoftWebDriver.exe %* --jwp

And on startup of my node I specify this batch file as driver for Edge:

java -Dwebdriver.edge.driver="D:\Driver\edgedriver.bat"^
     -Dwebdriver.ie.driver="D:\Driver\IEDriverServer.exe"^
     -Dwebdriver.chrome.driver="D:\Driver\chromedriver.exe"^
     -jar D:\Vaadin_Testbench_Node\vaadin-testbench-standalone-5.1.2.jar^
     -role node^
     -nodeConfig D:\Vaadin_Testbench_Node\nodeconfig.json
PAX
  • 888
  • 11
  • 29
  • 1
    Wow thanks , how is batch file working in this case? – PDHide Mar 17 '20 at 11:00
  • What exactly do you mean? The batch file only acts as a proxy. Finally, it invokes the actual web driver executable and passes one additional parameter which we need (`jwp`). – PAX Mar 18 '20 at 10:23
  • like how, is bat file being recognized by the selenium jar. Do you have pointer to the source code selenium standalone jar file ? – PDHide Mar 18 '20 at 10:26
  • 1
    I see. No, I'm sorry - I don't exactly know the underlying mechanism. At least, it _feels_ like that it simply _excutes_ the file. Since batch files are executable just like PE files, it works well. – PAX Mar 18 '20 at 20:56
  • ya thought the same , was just wondering how that thought of using a batch file and that two using % came to your . That was brilliant – PDHide Mar 18 '20 at 21:01
0

Try to add line below in file EdgeDriverService.java

argsBuilder.add("--jwp");

It can help web driver to launch in jwp mode.

Reference:

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

Deepak-MSFT
  • 8,111
  • 1
  • 6
  • 14
  • Hi Deepak, edgedriverservice file is jar file how we can add the arg into the jar file – Sai Jul 06 '19 at 23:48
  • Looks like you need to forked that library to make this changes. you can also try to refer the last post from link I suggested in my previous comment. – Deepak-MSFT Jul 08 '19 at 08:03