Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

nodejs + selenium-webdriver下,执行firefoxTest.js 报错了,哪位大神帮忙看一下是哪里的问题!

$
0
0

//firefoxTest.js var webdriver = require(‘selenium-webdriver’), By = webdriver.By, until = webdriver.until;

var driver = new webdriver.Builder() .forBrowser(‘firefox’) .build();

driver.get(‘https://www.baidu.com’); driver.findElement(By.id(‘kw’)).sendKeys(‘webdriver’); driver.findElement(By.id(‘su’)).click(); driver.wait(until.titleIs(‘webdriver_百度搜索’), 1000); driver.quit();

执行脚本: $ n use 7.6.0 firefoxTest.js /home/eli/workspace/autoTest/node_modules/selenium-webdriver/lib/promise.js:2634 throw error; ^

WebDriverError: Unable to parse new session response: {“value”:{“error”:“unknown error”,“message”:“Missing ‘marionetteProtocol’ field in handshake”,“stacktrace”:"stack backtrace:\n
0: 0x4d3f8d - backtrace::backtrace::trace::h0d01da48b5a2a3d1\n
1: 0x4d4452 - backtrace::capture::Backtrace::new::h90c05c8c72e0f6cd\n
2: 0x435b1d - geckodriver::marionette::MarionetteHandler::create_connection::he7a110f15ba82f44\n
3: 0x438298 - <geckodriver::marionette::MarionetteHandler as webdriver::server::WebDriverHandlergeckodriver::marionette::GeckoExtensionRoute>::handle_command::h4749945b9e0ef997\n
4: 0x4056e4 - std::panicking::try::do_call::h901d1278794bfce4\n
5: 0x58226a - panic_unwind::__rust_maybe_catch_panic\n
at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/src/libpanic_unwind/lib.rs:98\n
6: 0x418c04 - <F as alloc::boxed::FnBox<A>>::call_box::hacb8995bcbac970c\n
7: 0x57aa74 - alloc::boxed::{{impl}}::call_once<(),()>\n
at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/src/liballoc/boxed.rs:615\n

  • std::sys_common::thread::start_thread\n
    at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/src/libstd/sys_common/thread.rs:21\n - std::sys::imp::thread::{{impl}}::new::thread_start\n
    at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/src/libstd/sys/unix/thread.rs:84"}} at doSend.then.response (/home/eli/workspace/autoTest/node_modules/selenium-webdriver/lib/http.js:438:19) at process._tickCallback (internal/process/next_tick.js:103:7) From: Task: WebDriver.createSession() at Function.createSession (/home/eli/workspace/autoTest/node_modules/selenium-webdriver/lib/webdriver.js:777:24) at Function.createSession (/home/eli/workspace/autoTest/node_modules/selenium-webdriver/firefox/index.js:667:55) at createDriver (/home/eli/workspace/autoTest/node_modules/selenium-webdriver/index.js:167:33) at Builder.build (/home/eli/workspace/autoTest/node_modules/selenium-webdriver/index.js:642:16) at Object.<anonymous> (/home/eli/workspace/autoTest/test/firefoxTest.js:18:6) at Module._compile (module.js:571:32) at Object.Module._extensions…js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3)

Viewing all articles
Browse latest Browse all 14821

Trending Articles