WebDriver Capabilities Issue

Ranorex Studio, Spy, Recorder, and Driver.
owyndwight
Posts: 8
Joined: Thu Jul 06, 2017 3:51 pm

WebDriver Capabilities Issue

Post by owyndwight » Mon Oct 02, 2017 11:45 am

Hi Guys,

I have set up a simple web test and an endpoint which is on a Linux VM with Selenium Grid running. I can run this with no problems from Ranorex against either chromium or firefox on the endpoint without specifying any desired capabilities. However when i specify the capabilities within Ranorex or using the new parallel runner I get an error that it cannot find the capabilities.
You do not have the required permissions to view the files attached to this post.

Tomsk666
Certified Professional
Certified Professional
Posts: 34
Joined: Thu Mar 28, 2013 12:59 pm
Location: UK
Contact:

Re: WebDriver Capabilities Issue

Post by Tomsk666 » Mon Oct 02, 2017 2:04 pm

I have just tried this with Selenium Grid running on a physical machine with Windows 10 with the same problem.
When running with the Windows 10 Selenium Server as an endpoint from Ranorex without any capabilities defined it works fine. I can run against Chrome or Firefox remotely against the grid, no problem.
As soon as I define Selenium Capabilities for the endpoint (using the Ranorex Capabilities configurator web page), then I get the same error as the other user - Error forwarding the new session cannot find : Capabilities [{browserName=firefox, javascriptEnabled=true, version=45.0, platform=WIN10}]

The capabilities I am using are just:
{
"platform": "Windows 10",
"browserName": "firefox",
"version": "45.0"
}
I've also tried for Chrome and get the same error.
I'm using Ranorex 7.2, but also had the same issue in 7.1 when I tried it - can anyone help with this? Thanks

Tomsk666
Certified Professional
Certified Professional
Posts: 34
Joined: Thu Mar 28, 2013 12:59 pm
Location: UK
Contact:

Re: WebDriver Capabilities Issue

Post by Tomsk666 » Mon Oct 02, 2017 2:11 pm

Found the solution - Simply remove the Browser Version Capability.
As soon as I just use:
{
"platform": "Windows 10",
"browserName": "chrome",
}

or

{
"platform": "Windows 10",
"browserName": "firefox",
}

Then it works successfully.

Vega
Posts: 222
Joined: Tue Jan 17, 2023 7:50 pm

Re: WebDriver Capabilities Issue

Post by Vega » Mon Oct 02, 2017 8:48 pm

It seems you may not be using the same capabilities that your node is configured with. I just tested this on my own grid and was able to get it to successfully work. What does your node configuration JSON look like? Please give the below a try and let me know if it works for you:

From the Selenium HQ GitHub (https://github.com/SeleniumHQ/selenium/ ... pabilities):
Not all server implementations will support every WebDriver feature. Therefore, the client and server should use JSON objects with the properties listed below when describing which features a user requests that a session support. If a session cannot support a capability that is requested in the desired capabilities, no error is thrown; a read-only capabilities object is returned that indicates the capabilities the session actually supports.
Here is my config file for my node (notice the version capability):

Code: Select all

{
  "capabilities": [
    {
      "browserName": "firefox",
      "acceptSslCerts": true,
      "javascriptEnabled": true,
      "takesScreenshot": false,
      "firefox_profile": "",
      "version": "56.0",
      "platform": "WINDOWS",
      "maxInstances": 5,
      "firefox_binary": "",
      "cleanSession": true 
    },
    {
      "browserName": "chrome",
      "maxInstances": 5,
      "platform": "WINDOWS",
      "webdriver.chrome.driver": "chromedriver.exe"
    },
    {
      "browserName": "internet explorer",
      "maxInstances": 1,
      "platform": "WINDOWS",
      "webdriver.ie.driver": "IEDriverServer.exe" 
    }
  ]
  
  }
Here is the argument I'm using to start the node:

Code: Select all

java -jar selenium-server-standalone-3.6.0.jar -role node -hub http://localhost:4444/grid/register -nodeConfig jsonConfig.json -log output.txt
Here are my listed capabilities in Ranorex:

Code: Select all

{
  "browserName": "firefox",
  "version": "56.0"
}
Further documentation if you are not familiar with configuring selenium nodes:

https://seleniumhq.github.io/docs/grid.html

Hope this helps!

Tomsk666
Certified Professional
Certified Professional
Posts: 34
Joined: Thu Mar 28, 2013 12:59 pm
Location: UK
Contact:

Re: WebDriver Capabilities Issue

Post by Tomsk666 » Tue Oct 03, 2017 9:14 am

Thanks Vega,
You are absolutely correct, I haven't specified browser versions on the nodes, so this makes perfect sense, Thank you for your help :D