dequelabs / axe-webdriverjs

Provides a chainable axe API for Selenium's WebDriverJS and automatically injects into all frames.
Mozilla Public License 2.0
130 stars 46 forks source link

WebDriverError: Unable to parse new session response #30

Closed syndy1989 closed 7 years ago

syndy1989 commented 7 years ago

OS: Windows server 2012

Selenium-webdriver : 3.3.0

Browser: Firefox 51.0

Geckodriver for firefox: V0.15.0

I'm using the below snippet which will drive Selenium to this url, perform analysis and then log results to the console

var AxeBuilder = require('axe-webdriverjs'); var WebDriver = require('selenium-webdriver'); var driver = new WebDriver.Builder() .forBrowser('firefox') .build(); driver .get('https://www.ally.com') .then(function () { AxeBuilder(driver) .analyze(function (results) { console.log(results); }); });

Expected Behavior

Firefox: It supposed to open browser and test gets executed.

Actual Behavior

Firefox: browser opens but the test isn't executed. Get below error:

C:\Users\AppData\Roaming\npm\node_modules>node index.js C:\Users\AppData\Roaming\npm\node_modules\selenium-webdriver\lib\promise. js:2634 throw error; ^ WebDriverError: Unable to parse new session response: {"value": {"sessionId":"2e ae420c-06b5-4e7a-8646-c595edc311d9","value":{"XULappId":"{ec8030f7-c20a-464f-9b0 e-13a3a9e97384}","acceptSslCerts":false,"appBuildId":"20170125094131","browserNa me":"firefox","browserVersion":"51.0.1","command_id":1,"platform":"WINDOWS_NT"," platformName":"windows_nt","platformVersion":"6.3","processId":2228,"proxy":{}," raisesAccessibilityExceptions":false,"rotatable":false,"specificationLevel":0,"t akesElementScreenshot":true,"takesScreenshot":true,"version":"51.0.1"}}} at WebDriverError (C:\Users\AppData\Roaming\npm\node_modules\selenium -webdriver\lib\error.js:27:5) at doSend.then.response (C:\Users\AppData\Roaming\npm\node_modules\se lenium-webdriver\lib\http.js:438:19) at process._tickCallback (internal/process/next_tick.js:103:7) From: Task: WebDriver.createSession() at Function.createSession (C:\Users\AppData\Roaming\npm\node_modules\ selenium-webdriver\lib\webdriver.js:777:24) at Function.createSession (C:\Users\AppData\Roaming\npm\node_modules\ selenium-webdriver\firefox\index.js:667:55) at createDriver (C:\Users\AppData\Roaming\npm\node_modules\selenium-w ebdriver\index.js:167:33) at Builder.build (C:\Users\AppData\Roaming\npm\node_modules\selenium- webdriver\index.js:642:16) at Object.<anonymous> (C:\Users\AppData\Roaming\npm\node_modules\inde x.js:6:4) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)

Am i missing out something. Any advise on this would be helpful. Thanks in advance

marcysutton commented 7 years ago

I was able to repro this on Windows 8.1. It looks like a bug with Selenium-Webidrver 3.3.0 and Geckodriver: https://github.com/SeleniumHQ/selenium/issues/3625

I have the latest versions of everything, and I get the same error. Can you try downgrading to Selenium 3.0.1 and an older geckodriver while we do some investigating?

syndy1989 commented 7 years ago

Hi @marcysutton i tried downgrading the versions as you suggested. Its working now. Thank You so much for your assistance.

rakeshnambiar commented 6 years ago

Hi, @marcysutton I am facing this issue in protractor too. Is there any suggestion?

multiCapabilities: [ { browserName: 'firefox', firefoxOptions: { args: ['--headless'] }, 'moz:firefoxOptions': { args: [ '--headless' ] } } ],

marcysutton commented 6 years ago

@rakeshnambiar the solution to this issue was to downgrade the version of geckodriver on your PATH.