protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Selenium unable to acquire a session in Windows

Open cmplank opened this issue 12 years ago • 5 comments

I have a working protractor config that succeeded on 2 linux machines, but it failed on 2 windows machines (win7 and win8)

When I run protractor on the windows machines, I get the following output:

Starting selenium standalone server...
Selenium standalone server started at http://10.0.2.15:58384/wd/hub

C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1542
      throw error;
            ^
UnknownError: null
    at new bot.Error (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:109:18)
    at Object.bot.response.checkResponse (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:106:9)
    at C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:133:24
    at C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1178:15
    at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1438:20)
    at notify (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:328:12)
    at notifyAll (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:297:7)
    at fulfill (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:402:7)
    at C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1178:15
    at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1438:20)
==== async task ====
WebDriver.createSession()
    at Function.webdriver.WebDriver.acquireSession_ (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:130:49)
    at Function.webdriver.WebDriver.createSession (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:110:30)
    at Builder.build (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:105:20)
    at runJasmineTests (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:248:47)
    at C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:313:12
    at C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1178:15
    at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1438:20)
    at notify (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:328:12)
    at notifyAll (C:\Users\cmplank\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:297:7)

My e2e.conf.js:

exports.config = {
    seleniumServerJar: '../node_modules/selenium/lib/runner/selenium-server-standalone-2.20.0.jar',
    chromeDriver: '../node_modules/chromedriver/bin/chromedriver',
    baseUrl:'http://localhost:8080/',

    capabilities: {
        'browserName': 'chrome'
    },

    specs: [
        '../test/e2e/*.js'
    ],

    jasmineNodeOpts: {
        defaultTimeoutInterval: 30000
    }
};

It looks like it might just be a selenium issue but I thought I would start here. Any ideas?

cmplank avatar Jan 03 '14 15:01 cmplank

I should mention I've tried with protractor 0.14.0 and 0.16.0

cmplank avatar Jan 03 '14 18:01 cmplank

Is Chrome installed on the windows machines? If so, is it in the standard location? See http://code.google.com/p/selenium/wiki/ChromeDriver for where chromedriver expects it.

juliemr avatar Jan 10 '14 22:01 juliemr

@juliemr Chrome is installed on both machines. The Win7 computer has it installed in the expected location of C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe and the Win8 in C:\Program Files (x86)\Google\Chrome\Application\chrome.exe. I tried creating a shortcut in the expected location on the Win8 box just to see if that might help it along but I still get the same error when I run protractor.

In any event, that doesn't seem to be the sticking point since both computers get the same error. Any other thoughts?

cmplank avatar Jan 13 '14 15:01 cmplank

I had the same problem on Windows XP. To fix it, I installed Chrome in the correct location by uninstalling it from Program Files as admin and then installing it as a normal user. I installed ChromeDriver for Windows from http://chromedriver.storage.googleapis.com/index.html?path=2.8/ . I copied the exe file to C:\windows\system32. I started selenium server without -Dwebdriver.chrome.driver (since it is on my path).

bedwards avatar Jan 24 '14 23:01 bedwards

Thanks for the fix @bedwards. Closing this as it seems resolved.

juliemr avatar Mar 05 '14 01:03 juliemr