I am trying to run webdriverio on my windows 10 computer and keep running into the same issue when trying to run my test js file. So I run this -jar /your/download/directory/selenium-server-standalone-3.5.3.jar
to start the server and that comes out with this output
13:06:19.471 INFO - Selenium build info: version: '3.5.3', revision: 'a88d25fe6b'
13:06:19.472 INFO - Launching a standalone Selenium Server
2018-02-16 13:06:19.503:INFO::main: Logging initialized @301ms to org.seleniumhq.jetty9.util.log.StdErrLog
13:06:19.564 INFO - Driver class not found: com.opera.core.systems.OperaDriver
13:06:19.600 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN10
13:06:19.640 INFO - Using the passthrough mode handler
2018-02-16 13:06:19.673:INFO:osjs.Server:main: jetty-9.4.5.v20170502
2018-02-16 13:06:19.697:WARN:osjs.SecurityHandler:main: [email protected]@3e9b1010{/,null,STARTING} has uncovered http methods for path: /
2018-02-16 13:06:19.703:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@3e9b1010{/,null,AVAILABLE}
2018-02-16 13:06:19.807:INFO:osjs.AbstractConnector:main: Started ServerConnector@4e7dc304{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2018-02-16 13:06:19.808:INFO:osjs.Server:main: Started @605ms
13:06:19.808 INFO - Selenium Server is up and running
So after that I opened up a new command line prompt and ran my test.js file that looks like this
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);
});
And this is the error I get
{ Error: A new session could not be created.
at end() - C:\Users\KenyaThompson\Desktop\test.js:16:6
details: undefined,
message: 'Unable to create new service: ChromeDriverService\nBuild info: version: \'3.5.3\', revision: \'a88d25fe6b\', time: \'2017-08-29T12:54:15.039Z\'\nSystem info: host: \'LAPTOP-9GIHGJ9I\', ip: \'10.0.0.243\', os.name: \'Windows 10\', os.arch: \'amd64\', os.version: \'10.0\', java.version: \'1.8.0_161\'\nDriver info: driver.version: unknown',
type: 'RuntimeError',
seleniumStack:
{ type: 'SessionNotCreatedException',
message: 'A new session could not be created.',
orgStatusMessage: 'Unable to create new service: ChromeDriverService\nBuild info: version: \'3.5.3\', revision: \'a88d25fe6b\', time: \'2017-08-29T12:54:15.039Z\'\nSystem info: host: \'LAPTOP-9GIHGJ9I\', ip: \'10.0.0.243\', os.name: \'Windows 10\', os.arch: \'amd64\', os.version: \'10.0\', java.version: \'1.8.0_161\'\nDriver info: driver.version: unknown' } }
Could someone please explain to me what I am doing wrong here? Also yes I already installed chromedriver via npm as well as wdio-chromedriver-service.
Update your ChromeDriver version via webdriver-manager, as follows:
webdriver-manager clean
webdriver-manager update
webdriver-manager start
This will remove the older version, update with the latest stated in your built config, and restart the server. Hope this helps.
The error you are seeing does gives us some hint about whats going wrong as follows :
{ type: 'SessionNotCreatedException',
message: 'A new session could not be created.',
orgStatusMessage: 'Unable to create new service: ChromeDriverService\nBuild info: version: \'3.5.3\', revision: \'a88d25fe6b\', time: \'2017-08-29T12:54:15.039Z\'\nSystem info: host: \'LAPTOP-9GIHGJ9I\', ip: \'10.0.0.243\', os.name: \'Windows 10\', os.arch: \'amd64\', os.version: \'10.0\', java.version: \'1.8.0_161\'\nDriver info: driver.version: unknown' }
It is clear from the error message that the ChromeDriver is not getting detected as you see the log message as Driver info: driver.version: unknown
. The main reason of this error can be the incompatibility between the binaries you are using.
A quick solution would be to :
When you start your Grid Node, make sure the path to the chromedriver.exe in -Dwebdriver.chrome.driver parameter is correct: Example:
java -Dwebdriver.chrome.driver="C:\DEV\eclipse\MainWorkspace\webdrivers\chromedriver.exe" -jar selenium-server-standalone-3.141.59.jar -role node -hub http://localhost:4444/grid/register -nodeConfig node-config.json > node_output.log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With