SeleniumHQ / selenium

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

'Unexpected Error' trying to start tests on selenium grid with standalone server 3.5.0 #4442

Closed jburns24 closed 4 years ago

jburns24 commented 7 years ago

Meta -

OS: windows-2008-r2-x64

Selenium Version: selenium-server-standalone-3.5.0 selenium.webdriver 3.5 selenium.support 3.5

Browser:
chrome 60.0.3112.90 firefox 54.0.1

Expected Behavior -

Browser opens and driver is connected to browser

Actual Behavior -

When initiating the driver I get the following error

2017-08-11 11:49:36,943 ERROR ExistingUserTest - OpenQA.Selenium.WebDriverException: Unexpected error. 
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   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.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout)
   at POMAuctivaTest.TestSuite.ExistingUserTestSuite.SetUp() in C:\git\auctiva-webdriver\POMAuctivaTest.TestSuite\ExistingUserTestSuite.cs:line 66

I have tested this with the exact same setup except selenium standalone serve 2.53.0 and everything worked. I was still using the latest selenium webdriver and selenium support libraries (3.5) when testing on selenium standalone server 2.

Steps to reproduce -

DesiredCapabilities chromeCapability = DesiredCapabilities.Chrome();
chromeCapability.SetCapability(CapabilityType.BrowserName, "chrome");
chromeCapability.SetCapability(CapabilityType.Platform, new Platform(PlatformType.Windows));
Driver = new RemoteWebDriver(new Uri("http://localhost:4446/wd/hub"), chromeCapability, TimeSpan.FromMinutes(2));
svetikshark commented 7 years ago

Having same issue with firefox

james-radford commented 6 years ago

I'm having exactly the same issue.

nadvolod commented 6 years ago

Having same exact issue with:

            var options = new ChromeOptions();
            //options.AddExtension(outPutDirectory + @"\3.1.3_1.crx");
            options.AddExtension(@"C:\Users\Administrator\Desktop\3.1.5_0.crx");

            //options.AddAdditionalCapability(CapabilityType.Version, "57.0", true);
            options.AddAdditionalCapability(CapabilityType.Platform, "WIN10", true);

            return new RemoteWebDriver(new Uri("http://10.0.0.215:4444/wd/hub"), options.ToCapabilities());
netzulo commented 6 years ago

@jburns24 , @nadvolod , @james-radford, @svetikshark

my tests for remote firefox it's working succesfully with own node + hub, can you paster your config JSON file and params used on command lane to start node and hub ,probably missconfiguration error

you can check my tests for each driver here : https://github.com/netzulo/qacode

windows: https://ci.appveyor.com/project/netzulo/qacode/build/1.0.583/job/mhaa5tvtqwvw5whk linux: https://travis-ci.org/netzulo/qacode/jobs/320072991

Expect be usefull :)

jburns24 commented 6 years ago

@netzulo Since posting this issue I kept our test machines running on 2.53 I recently had success updating the sandalone server and webdriver binding to 3.7.0 And have had success with and am no longer experiencing this issue.

nadvolod commented 6 years ago

@netzulo I didn't configure with a JSON and I posted my configuration code above in my question. I used the standard command line parameters to start the node and the hub:

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

The nodes get registered and everything runs until it hist the RemoteWebDriver as specified initially by @jburns24. Then I get that error.

By the way, I see that you're using Selenium Server 3.5.3. Maybe I need to downgrade to an older version?

netzulo commented 6 years ago

umm some troubles at update hub to v3.8.x or v3.7.x @jburns24, i wanted to upgrade but ill keep 3.5.3 ( @nadvolod feels more secure :) )

im using this drivers if you need check them too :) : https://github.com/netzulo/qadrivers

nadvolod commented 6 years ago

@netzulo are you saying that you also had trouble with selenium server 3.8 and 3.7?

netzulo commented 6 years ago

let me upload to github my local branch for paste CI jobs here :) @nadvolod

netzulo commented 6 years ago

Hey guys, some news!

selenium.node.json

(qalab) [ntz@ntz-qa]/opt/ntz/qalab: python qalab/qalab.py -sd selenium -m node -p lin64 --start INFO: Executing command : ['java', '-Dwebdriver.chrome.driver=modules/qadrivers/chromedriver_64', '-Dwebdriver.gecko.driver=modules/qadrivers/firefoxdriver_64', '-Dphantomjs.binary.path=modules/qadrivers/phantomjsdriver_64', '-Dwebdriver.opera.driver=modules/qadrivers/operadriver_64', '-jar', 'qalab/drivers/selenium-server-standalone-3.7.0.jar', '-role', 'node', '-nodeConfig', 'qalab/configs/selenium.node.json', '-log', 'logs/selenium.node.log']

{
  "capabilities": [
    {
      "browserName": "firefox",
      "maxInstances": 5,
      "seleniumProtocol": "WebDriver",
      "platform": "LINUX"
    }
  ],
  "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
  "maxSession": 25,
  "port": 11001,
  "register": true,
  "registerCycle": 5000,
  "hub": "http://192.168.0.1:11000"
}

selenium.hub.json

(qalab) [ntz@ntz-qa]/opt/ntz/qalab: python qalab/qalab.py -sd selenium -m hub --start INFO: Executing command : ['java', '-jar', 'qalab/drivers/selenium-server-standalone-3.7.0.jar', '-> role', 'hub', '-hubConfig', 'qalab/configs/selenium.hub.json', '-log', 'logs/selenium.hub.log']

{
  "host": "192.168.0.1",
  "port": 11000,
  "newSessionWaitTimeout": -1,
  "servlets" : [],
  "prioritizer": null,
  "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
  "throwOnCapabilityNotPresent": true,
  "nodePolling": 5000,
  "cleanUpCycle": 5000,
  "browserTimeout": 0,
  "jettyMaxThreads":-1
}

What driver files are using ? can i download ?

Yes! download from here qadrivers for firefox

Results

HUB output log

17:26:44.622 INFO - Got a request to create a new session: Capabilities {acceptInsecureCerts: true, browserName: firefox, marionette: true}
17:26:44.622 INFO - Trying to create a new session on test slot {seleniumProtocol=WebDriver, browserName=firefox, maxInstances=5, platform=LINUX}

NODE output log

emtpy file...

Finally

Not working v3.7.0 using same firefoxdriver on selenium v3.5.3

I need to update my project to change more easily selenium versions, and add it to public expect this helps all !

@jburns24 @svetikshark @james-radford @nadvolod @barancev

jburns24 commented 6 years ago

@netzulo So I just checked my environment and I am working on selenium-standalone-server 3.7.1. I dont recall if I ever attempted to update to 3.7.0 I may have tried and had issues with it here is my node and hub configs but your configs looks good to me, have you tried 3.7.1? Also I looked at your drivers repo and cant tell if you are running geckodriver 19.0.1 if so that is the version of geckodriver that I have had success with.

Selenium Node Config

{
  "capabilities":
  [
    {
      "browserName": "firefox",
      "maxInstances": 5,
      "seleniumProtocol": "WebDriver"
    },
    {
      "browserName": "chrome",
      "maxInstances": 5,
      "seleniumProtocol": "WebDriver"
    },
    {
      "browserName": "internet explorer",
      "maxInstances": 1,
      "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": {}
}

Selenium Grid Config

{
  "newSessionWaitTimeout": -1,
  "servlets": [],
  "withoutServlets": [],
  "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
  "throwOnCapabilityNotPresent": true,
  "cleanUpCycle": 5000,
  "timeout": 1800,
  "debug": true,
  "timeout": 1800,
  "browserTimeout": 0,
  "maxSession": 5,
  "jettyMaxThreads": 0,
  "port": 4444
}
netzulo commented 6 years ago

@jburns24

rename this on configs , to ensure environment configuration, not use localhost , use real ips what are using in node ( or balance with domain name and nginx ) , so...

selenium.node.json

(qalab) [ntz@ntz-qa]/opt/ntz/qalab: python qalab/qalab.py -sd selenium -m node -p lin64 --start INFO: Executing command : ['java', '-Dwebdriver.chrome.driver=modules/qadrivers/chromedriver_64', '-Dwebdriver.gecko.driver=modules/qadrivers/firefoxdriver_64', '-Dphantomjs.binary.path=modules/qadrivers/phantomjsdriver_64', '-Dwebdriver.opera.driver=modules/qadrivers/operadriver_64', '-jar', 'qalab/drivers/selenium-server-standalone-3.7.0.jar', '-role', 'node', '-nodeConfig', 'qalab/configs/selenium.node.json', '-log', 'logs/selenium.node.log']

  "host": "192.168.0.1",
  "port": 11001,
  "hub": "http://192.168.0.1:11000"

selenium.hub.json

(qalab) [ntz@ntz-qa]/opt/ntz/qalab: python qalab/qalab.py -sd selenium -m hub --start INFO: Executing command : ['java', '-jar', 'qalab/drivers/selenium-server-standalone-3.7.0.jar', '-> role', 'hub', '-hubConfig', 'qalab/configs/selenium.hub.json', '-log', 'logs/selenium.hub.log']

  "host": "192.168.0.1",
  "port": 11000,

I think i was using geckodriver v0.19.0 , so let me repeat tests...

Tests

diemol commented 4 years ago

After reading the comments, it seems like you all were able to figure it out after some upgrades.

I will close this as it seems that no more actions are needed.