Exception creating remote session - Selenium v3.0.1 Grid, RemoteWebDriver, Edge, Java bindings

1,505 views
Skip to first unread message

Kendall Schmidt

unread,
Dec 2, 2016, 3:55:11 PM12/2/16
to Selenium Users
I'm trying to create a remote session to a Windows 10 Edge VM running as a node in a Selenium v3.0.1 grid.

I'm running the following:
  • Selenium v3.0.1, using Java bindings
  • Windows 10 Edge VM v14393.447
  • MicrosoftWebDriver.exe v14.14393

I've set the system property 'webdriver.edge.driver' to point to the absolute path where the 'MicrosoftWebDriver.exe' resides on the Windows 10 Edge VM.


In my code I'm doing:


DesiredCapabilities capabilities = DesiredCapabilities.edge();
RemoteWebDriver webdriver = new RemoteWebDriver(seleniumHubUrl, capabilities);

This results in the following exception:

org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{proxy={proxyAutoconfigUrl=null, autodetect=false, socksUsername=null, socksPassword=null, httpProxy=null, proxyType=DIRECT, noProxy=null, ftpProxy=null, socksProxy=null, hCode=1600785259, class=org.openqa.selenium.Proxy, sslProxy=null}, browserVersion=14, browserName=MicrosoftEdge, takesScreenshot=true, version=14, platform=WINDOWS, unexpectedAlertBehaviour=ignore}], required capabilities = Capabilities [{}]
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'MSEDGEWIN10', ip: '10.110.132.36', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_111'
Driver info: driver.version: EdgeDriver
Command duration or timeout: 0 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'

Not sure what I'm missing or have improperly configured. I follow this exact code model for ChromeDriver, Firefox/GeckoDriver, Internet Explorer/IEDriverServer.

Any insight would be greatly appreciated.

BlackFrost

unread,
Dec 5, 2016, 8:22:46 PM12/5/16
to Selenium Users
Hey,

The code part looks ok, so I'd say that's definitely a configuration issue.

Let's start with the hub/node command lines that you run to start a grid. Can you please provide them here?

Meanwhile can you try running Edge with just a local grid:

HUB:
java -jar selenium-server-standalone-<version>.jar -role hub

NODE:
java -jar selenium-server-standalone-<version>.jar -role node -hub http://localhost:4444/grid/register

And (I know you've mentioned it, but still) can you please double check you have "Path" System Variable pointing to the location of your "MicrosoftWebDriver.exe"? Just to make sure we are not missing it. For example:




Auto Generated Inline Image 1

Kendall Schmidt

unread,
Dec 6, 2016, 2:33:39 PM12/6/16
to Selenium Users
I am highly confident the hub/node configurations are correct as I have 2 independent Selenium Grids running (since Selenium v2.x days) with 50+ nodes registered to each hub and all are functional, using/deploying ChromeDriver, FirefoxDriver (extension for v47.0.1 or less), GeckoDriver (Firefox v48+), and IEDriverServer (IE8-11).

I can see the new VM's running Windows 10/Edge are up and running *and* registered to the hub.

Could it be I'm setting the incorrect System property '
webdriver.edge.driver'? You mention I should be setting the system property "Path". Is this correct?

I'm setting the system property 'webdriver.edge.driver' to C:\Users\ADMINI~1\AppData\Local\Temp\MicrosoftWebDriver.exe on the node. Is it possible I should only be specifying the path portion (drop
MicrosoftWebDriver.exe)?

Kendall Schmidt

unread,
Dec 6, 2016, 3:13:53 PM12/6/16
to Selenium Users
I can also add that the ProtocolHandshake.createSession() method is calling POST /session from within RemoteWebDriver.execute(). This does start the MicrosoftWebDriver.exe process on the node but the result being returned to RemoteWebDriver is some kind of error, therefore the session create fails.  The MicrosoftWebDriver.exe process is left running on the node as well.

BlackFrost

unread,
Dec 7, 2016, 4:50:16 AM12/7/16
to Selenium Users
Hi Kendall,

That is very peculiar. You are saying that MicrosoftWedDriver.exe is left running, so the local node finds it. However, looking at the error message you get, it still can't create a session.

1) As for adding driver location to the PATH variable, sorry can't find the initial resource I got it from, but I find it briefly mentioned here https://blogs.windows.com/msedgedev/2015/07/23/bringing-automated-testing-to-microsoft-edge-through-webdriver/#pbgBuwUUWTp9qgAH.97 - checkout the comments in the sample code provided on this page:

/*
 * This assumes you have added MicrosoftWebDriver.exe to your System Path.
 * For help on adding an exe to your System Path, please see:
 * https://msdn.microsoft.com/en-us/library/office/ee537574(v=office.14).aspx  
 */

Anyway, it is worth trying.

2) Another guess, if you are using json config for node you may want to checks if it is formatted according to the new template:
The old one 2.xx : https://github.com/SeleniumHQ/selenium/blob/selenium-2.53.0/java/server/src/org/openqa/grid/common/defaults/DefaultNode.json
The new one 3.xx: https://github.com/SeleniumHQ/selenium/blob/master/java/server/src/org/openqa/grid/common/defaults/DefaultNodeWebDriver.json

I'm taking this info from https://github.com/SeleniumHQ/selenium/wiki/Grid2

I'm still concerned about the
"required capabilities = Capabilities [{}]" that you get as part of the error message. It is empty. Shouldn't it at least hold the browser name something like 'MicrosoftEdge'

Kendall Schmidt

unread,
Dec 7, 2016, 6:51:26 PM12/7/16
to seleniu...@googlegroups.com
1) For clarification, all this is running in a grid configuration, not locally. I’m setting a system property (via java code) on the remote node pointing to the executable, therefore, I am not setting it in the PATH environment variable, which is they way you would do it if running locally and do not want to programmatically do so like I am.

2) Yes, I’m setting the hub/node configurations using the new JSON format. This is working for all my nodes, as they all are getting registered to the hub correctly. I can see all of them in the Selenium grid console. All my nodes work just fine if the browser targeted for testing is 1) Firefox, 2) Chrome, 3)IE 8-11, just not for Edge.

As for the “required capabilities” being empty, this is normal, for most configurations. In general only the “desired capabilities” is populated. If-and-only-if I’m setting a proxy for the Mozilla GeckoDriver (i.e. Firefox browser) do I explicitly set “required capabilities”, as this is a work-around for GeckoDriver not currently supporting proxies in the “desired capabilities”.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/6HBET9etuaY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/5717e5a6-c198-4c9d-b5eb-b293386a022a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

BlackFrost

unread,
Dec 13, 2016, 3:48:48 AM12/13/16
to Selenium Users
Well, the VMs I use for testing are set up at the office so not to break the configs there I replicated edge config on my home machine with a local grid (that should be pretty similar to a remove vm after all).

Note: I shortened the name of the standalone server to just "srv3"

1) Here're my "local-hub" batch file contents:
java -jar srv3.jar -role hub -hubConfig local-hub-config.json

And here's the local-hub-config.json file:
{
 
"host": localhost,
 
"port": 4444,
 
"newSessionWaitTimeout": -1,
 
"servlets" : [],
 
"prioritizer": null,
 
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
 
"throwOnCapabilityNotPresent": true,
 
"nodePolling": 5000,

 
"cleanUpCycle": 5000,
 
"timeout": 300000,
 
"browserTimeout": 0,
 
"maxSession": 4,
 
"jettyMaxThreads":-1
}

2) The "local-node" batch is the following:
java -jar "<path-to-folder>\srv3.jar" -role node -nodeConfig "<path-to-folder>\local-node-config.json"

And the local-node-config.json:

{
 
"capabilities":
 
[
   
{
     
"browserName": "firefox",
     
"maxInstances": 5,
     
"seleniumProtocol": "WebDriver"
   
},
   
{
     
"browserName": "chrome",
     
"maxInstances": 3,
     
"seleniumProtocol": "WebDriver"
   
},
   
{
     
"browserName": "internet explorer",
     
"maxInstances": 3,
     
"seleniumProtocol": "WebDriver"
   
},
   
{
     
"browserName": "MicrosoftEdge",
     
"maxInstances": 3,
     
"seleniumProtocol": "WebDriver"
   
}
 
],
 
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
 
"maxSession": 5,
 
"port": 5555,
 
"register": true,
 
"registerCycle": 5000,
 
"hub": "http://localhost:4444",
 
"nodeStatusCheckTimeout": 5000,
 
"nodePolling": 5000,
 
"role": "node",
 
"unregisterIfStillDownAfter": 60000,
 
"downPollingLimit": 2,
 
"debug": false,
 
"servlets" : [],
 
"withoutServlets": [],
 
"custom": {}
}

3) I placed "MicrosoftWebDriver.exe" in the same location were standalone server was. Obviously not setting the system property in the code.

Running Grid Console showed all the browsers:


It worked perfectly fine for me what I executed the code (it's in C# obviously but that can barely be the difference that made it work for me)
 
[TestMethod]
       
public void TestMethod1()
       
{
           
DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities
= DesiredCapabilities.Edge();
           
           
RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capabilities, new TimeSpan(0, 0, 10));
            driver
.Manage().Window.Maximize();

            driver
.Navigate().GoToUrl("http://www.mail.com");

            driver
.Quit();
       
}


Sorry, can't think of anything else. Hope this helps in a way.

If you get to a solution for your problem can you please share it here?

P.S> I'm still concerned about your desired capabilities. When I tried to request capabilities that I couldn't match I got an error pretty similar to yours). Cheers.

Auto Generated Inline Image 1
Auto Generated Inline Image 2

Kendall Schmidt

unread,
Dec 13, 2016, 2:37:54 PM12/13/16
to seleniu...@googlegroups.com
I appreciate you sharing your information. I know it is something simply/subtle. Once I figure it out I’ll post it here.

Thanks again.


<Auto Generated Inline Image 1.png><Auto Generated Inline Image 2.png>


It worked perfectly fine for me what I executed the code (it's in C# obviously but that can barely be the difference that made it work for me)
 
[TestMethod]
       
public void TestMethod1()
       
{
           
DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities
= DesiredCapabilities.Edge();
           
           
RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capabilities, new TimeSpan(0, 0, 10));
            driver
.Manage().Window.Maximize();

            driver
.Navigate().GoToUrl("http://www.mail.com");

            driver
.Quit();
       
}


Sorry, can't think of anything else. Hope this helps in a way.

If you get to a solution for your problem can you please share it here?

P.S> I'm still concerned about your desired capabilities. When I tried to request capabilities that I couldn't match I got an error pretty similar to yours). Cheers.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/6HBET9etuaY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
<Auto Generated Inline Image 1.png><Auto Generated Inline Image 2.png>

Kendall Schmidt

unread,
Jan 12, 2017, 5:54:10 PM1/12/17
to Selenium Users
@BlackFrost -

Could you share 1) what type of windows 10 you are using (Enterprise vs Pro)?  2) What OS build it is and 3) What MicrosoftWebDriver version you are using?

I filed this problem with MicrosoftWebDriver team https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10088793/ and they confirmed it was a problem.

I would really like to know how your grid environment might differ then mine.
Reply all
Reply to author
Forward
0 new messages