0

I am trying to run the test script from webdriverIO.

This is the code:

var webdriverio = require('webdriverio');
var options = {
    desiredCapabilities: {
        browserName: 'chrome'
    }
};

webdriverio
    .remote(options)
    .init()
    .url('http://www.google.com')
    .getTitle().then(function(title) {
        console.log('Title was: ' + title);
    })
    .end()
    .catch(function(err) {
        console.log(err);
    });

When i run this, i get errors that i cannot understand. This is what Node tells me:

C:\...\webdriverio-node>node test.js
{ Error: A new session could not be created.
    at end() - C:\...\webdriverio-node\test.js:15:6
  details: undefined,
  message: 'Unable to create session from org.openqa.selenium.remote.NewSessionP
ayload@25bd2276\nBuild info: version: \'3.11.0\', revision: \'e59cfb3\', time: \
'2018-03-11T20:33:15.31Z\'\nSystem info: host: \'USER-PC\', ip: \'\', os.name: \'Windows 7\', os.arch: \'amd64\', os.version: \'6.1\', java.vers
ion: \'1.8.0_171\'\nDriver info: driver.version: unknown',
  type: 'RuntimeError',
  seleniumStack:
   { type: 'SessionNotCreatedException',
     message: 'A new session could not be created.',
     orgStatusMessage: 'Unable to create session from org.openqa.selenium.remote
.NewSessionPayload@25bd2276\nBuild info: version: \'3.11.0\', revision: \'e59cfb
3\', time: \'2018-03-11T20:33:15.31Z\'\nSystem info: host: \'USER-PC\', ip: \'\', os.name: \'Windows 7\', os.arch: \'amd64\', os.version: \'6.1\
', java.version: \'1.8.0_171\'\nDriver info: driver.version: unknown' } }

And this is the message i get from selenium-server-standalone:

16:49:43.014 INFO [ActiveSessionFactory.apply] - Capabilities are: Capabilities
{browserName: chrome, handlesAlerts: true, javascriptEnabled: true, locationCont
extEnabled: true, loggingPrefs: org.openqa.selenium.logging..., requestOrigins:
{name: webdriverio, url: http://webdriver.io, version: 4.12.0}, rotatable: true}

16:49:43.016 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.o
penqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selen
ium.chrome.ChromeDriverService)

When i change line 4 from the code to:

browserName: 'firefox'

This is the error that Node.js generates:

C:\...\webdriverio-node>node test.js
{ Error: An unknown server-side error occurred while processing the command.
    at end() - C:\...\webdriverio-node\test.js:15:6
  details: undefined,
  message: 'Process unexpectedly closed with status -1073741511\nBuild info: ver
sion: \'3.11.0\', revision: \'e59cfb3\', time: \'2018-03-11T20:33:15.31Z\'\nSyst
em info: host: \'USER-PC\', ip: \'\', os.name: \'Windows 7\', os
.arch: \'amd64\', os.version: \'6.1\', java.version: \'1.8.0_171\'\nDriver info:
 driver.version: unknown\nremote stacktrace: ',
  type: 'RuntimeError',
  seleniumStack:
   { type: 'UnknownError',
     message: 'An unknown server-side error occurred while processing the comman
d.',
     orgStatusMessage: 'Process unexpectedly closed with status -1073741511\nBui
ld info: version: \'3.11.0\', revision: \'e59cfb3\', time: \'2018-03-11T20:33:15
.31Z\'\nSystem info: host: \'USER-PC\', ip: \'\', os.name: \'Win
dows 7\', os.arch: \'amd64\', os.version: \'6.1\', java.version: \'1.8.0_171\'\n
Driver info: driver.version: unknown\nremote stacktrace: ' } }

And this is what selenium-server-standalone tells me:

16:50:53.332 INFO [ActiveSessionFactory.apply] - Capabilities are: Capabilities
{browserName: firefox, handlesAlerts: true, javascriptEnabled: true, locationCon
textEnabled: true, loggingPrefs: org.openqa.selenium.logging..., requestOrigins:
 {name: webdriverio, url: http://webdriver.io, version: 4.12.0}, rotatable: true
}
16:50:53.335 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.o
penqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selen
ium.firefox.GeckoDriverService)
1524577853389   geckodriver     INFO    geckodriver 0.20.0
1524577853399   geckodriver     INFO    Listening on 127.0.0.1:42211
1524577854396   mozrunner::runner       INFO    Running command: "C:\\Program Fi
les (x86)\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\Us
er\\AppData\\Local\\Temp\\rust_mozprofile.oSWu443RM4TY"

I am using selenium-server-standalone-3.11.0.jar

2
  • IMO, you need to reduce the scope of the question either to ChromeDriver or GeckoDriver updating with all the binary version information for further analysis. Commented Apr 24, 2018 at 14:55
  • I added here both. I don't know what else to put here for further information. Commented Apr 24, 2018 at 15:15

2 Answers 2

1

This is because appropriate binary could not be found. Checkout this Setup-Chrome section of webdriver.io

With the latest version of Selenium most of the drivers for the browser come with an external driver that has to be downloaded and setup.

Download the latest version of chromedriver from chromedriver for OS and either place it in the same location as ur test.js or set a PATH in windows. It would be automatically picked up. I only tried it with chrome and was able to execute your code successfully.

Personally I use webdriver-manager to manager binaries

npm install webdriver-manager

webdriver-manager update

webdriver-manager start

This will setup all required binary drivers to connect to browser

Sign up to request clarification or add additional context in comments.

Comments

0

I was able to solve the firefox part, just be reinstalling Firefox, as the browser installation was corrupted.

Unfortunately though, i was dissapointed that WebdriverIO spawned the Firefox browser before i get back my result.

I don't know if it's possible to run it in headless mode.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.