我正在遵循本指南:http://webdriver.io/guide.html和Firefox版本,我正在使用62.0
我遵循以下步骤:
使用命令java -jar -Dwebdriver.gecko.driver =。/ geckodriver selenium-server-standalone-3.5.3.jar
然后运行命令npm install webdriverio
var webdriverio = require('webdriverio'); var options = { desiredCapabilities: { browserName: 'firefox' } }; 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); });
而不是输出“标题为:Google” 我收到错误
{ Error: An unknown server-side error occurred while processing the command.
at end() - test.js:15:6
details: undefined,
message: 'connection refused\nBuild info: version: \'3.4.0\', revision: \'unknown\', time: \'unknown\'\nSystem info: host: \'RITESHs-MacBook-Pro.local\', ip: \'192.168.1.2\', os.name: \'Mac OS X\', os.arch: \'x86_64\', os.version: \'10.13.6\', java.version: \'1.8.0_171\'\nDriver info: driver.version: FirefoxDriver\nremote stacktrace: stack backtrace:\n 0: 0x10b43d49e - backtrace::backtrace::trace::h3ab5720c483fe461\n 1: 0x10b43d4dc - backtrace::capture::Backtrace::new::h096accf58447e0d5\n 2: 0x10b376534 - webdriver::error::WebDriverError::new::hc0958d01acda7bfc\n 3: 0x10b37d300 - geckodriver::marionette::MarionetteHandler::create_connection::h59a68c8dfef48e54\n 4: 0x10b35cd3c - _$LT$webdriver..server..Dispatcher$LT$T$C$$u20$U$GT$$GT$::run::h5a26ba0bb4fdb139\n 5: 0x10b3350c5 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3f868f7a1a12bdcc\n 6: 0x10b33fd2d - std::panicking::try::do_call::hfce1ad2a948c3632\n 7: 0x10b4e9a5c - __rust_maybe_catch_panic\n 8: 0x10b352eb5 - _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h651dedb755194a8c\n 9: 0x10b4e5c4b - std::sys::imp::thread::Thread::new::thread_start::h48c72bb09587cbc3\n 10: 0x7fff515f0660 - _pthread_body\n 11: 0x7fff515f050c- _pthread_start',
type: 'RuntimeError',
seleniumStack:
{ type: 'UnknownError',
message: 'An unknown server-side error occurred while processing the command.',
orgStatusMessage: 'connection refused\nBuild info: version: \'3.4.0\', revision: \'unknown\', time: \'unknown\'\nSystem info: host: \'RITESHs-MacBook-Pro.local\', ip: \'192.168.1.2\', os.name: \'Mac OS X\', os.arch: \'x86_64\', os.version: \'10.13.6\', java.version: \'1.8.0_171\'\nDriver info: driver.version: FirefoxDriver\nremote stacktrace: stack backtrace:\n 0: 0x10b43d49e - backtrace::backtrace::trace::h3ab5720c483fe461\n 1: 0x10b43d4dc - backtrace::capture::Backtrace::new::h096accf58447e0d5\n2: 0x10b376534 - webdriver::error::WebDriverError::new::hc0958d01acda7bfc\n 3: 0x10b37d300 - geckodriver::marionette::MarionetteHandler::create_connection::h59a68c8dfef48e54\n 4: 0x10b35cd3c - _$LT$webdriver..server..Dispatcher$LT$T$C$$u20$U$GT$$GT$::run::h5a26ba0bb4fdb139\n 5: 0x10b3350c5 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3f868f7a1a12bdcc\n 6: 0x10b33fd2d - std::panicking::try::do_call::hfce1ad2a948c3632\n 7: 0x10b4e9a5c - __rust_maybe_catch_panic\n 8: 0x10b352eb5 - _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h651dedb755194a8c\n 9: 0x10b4e5c4b - std::sys::imp::thread::Thread::new::thread_start::h48c72bb09587cbc3\n 10: 0x7fff515f0660 - _pthread_body\n 11: 0x7fff515f050c - _pthread_start' } }
任何人都可以指导如何解决此错误?
答案 0 :(得分:1)
似乎有些混乱。您已经提到:
命令
java -jar -Dwebdriver.gecko.driver=./geckodriver selenium-server-standalone-3.5.3.jar
observe the versioning ^^^ info
日志消息反映:
Build info: version: \'3.4.0\'