Я пытаюсь запустить тестовый скрипт из webdriverIO.
Это код:
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);
});
Когда я запускаю это, я получаю ошибки, которые не могу понять.Это то, что Node говорит мне:
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' } }
И это сообщение, которое я получаю от 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)
Когда я изменяю строку 4 из кода на:
browserName: 'firefox'
Это ошибка, которую генерирует Node.js:
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: ' } }
А вот что говорит мне сервер-селен:
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"
Яиспользование selenium-server-standalone-3.11.0.jar