I am trying to use Selenium to run some unit tests, but am facing difficulty in getting it to run. Every time i execute my code, chrome starts to open and then immediately crashes.
I have done some research and people suggest this can happen when you have too many instances running or when the chromedriver/chrome version do not align, however I have checked and neither seem to be the issue.
Below is the console error that I receive...
(node:76034) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SessionNotCreatedError: session not created exception
from disconnected: unable to connect to renderer
(Session info: chrome=66.0.3359.117)
(Driver info: chromedriver=2.37.544337 (8c0344a12e552148c185f7d5117db1f28d6c9e85),platform=Mac OS X 10.13.4 x86_64)
And this is the code that i am running (this is just a quick example I took to try and get selenium running)... ```
var webdriver = require('selenium-webdriver');
var browser = new webdriver.Builder()
.usingServer()
.withCapabilities({ browserName: 'chrome' })
.build();
browser.get('http://en.wikipedia.org/wiki/Wiki');
browser
.findElements(webdriver.By.css('[href^="/wiki/"]'))
.then(function(links) {
console.log('Found', links.length, 'Wiki links.');
browser.quit();
});
Any help would be much appreciated