Selenium webdriver 使用硒独立罐对phantomjs进行量角器测试,
我试图使用selenium-standalone-server.jar在phantomjs上运行量角器测试,但它给了我这样的错误。我在ubuntu 14.04中运行这个 这是我的dragrator-config.js文件Selenium webdriver 使用硒独立罐对phantomjs进行量角器测试,,selenium-webdriver,cucumber,phantomjs,protractor,ubuntu-14.04,Selenium Webdriver,Cucumber,Phantomjs,Protractor,Ubuntu 14.04,我试图使用selenium-standalone-server.jar在phantomjs上运行量角器测试,但它给了我这样的错误。我在ubuntu 14.04中运行这个 这是我的dragrator-config.js文件 exports.config = { framework: 'cucumber', seleniumServerJar: 'node_modules/selenium-standalone/.selenium/2.43.1/server.jar',
exports.config = {
framework: 'cucumber',
seleniumServerJar: 'node_modules/selenium-standalone/.selenium/2.43.1/server.jar',
specs: [
'specs/cucumber/*.feature'
],
baseUrl: '',
cucumberOpts: {
format: 'pretty'
},
capabilities: {
browserName: 'phantomjs',
'phantomjs.binary.path': 'node_modules/phantomjs/bin/phantomjs',
shardTestFiles: true,
maxInstances: 3
}
};
错误:
Running "protractor:phantom" (protractor) task
Starting selenium standalone server...
Selenium standalone server started at http://172.31.9.51:38462/wd/hub
PROJECT_DIR/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:148
var session = flow.execute(function() {
^
UnknownError: The driver is not executable: PROJECT_DIR/node_modules/phantomjs/bin/phantomjs
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (PROJECT_DIR/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:148:22)
at Function.webdriver.WebDriver.createSession (PROJECT_DIR/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:122:30)
at Builder.build (PROJECT_DIR/node_modules/protractor/node_modules/selenium-webdriver/builder.js:293:22)
at LocalDriverProvider.getDriver (PROJECT_DIR/node_modules/protractor/lib/driverProviders/local.js:121:9)
at PROJECT_DIR/node_modules/protractor/lib/runner.js:238:41
at _fulfilled (PROJECT_DIR/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (PROJECT_DIR/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (PROJECT_DIR/node_modules/protractor/node_modules/q/q.js:759:13)
at PROJECT_DIR/node_modules/protractor/node_modules/q/q.js:573:44
>>
Fatal error: protractor exited with code: 1
运行“量角器:幻影”(量角器)任务
正在启动selenium独立服务器。。。
Selenium独立服务器在启动http://172.31.9.51:38462/wd/hub
PROJECT_DIR/node_modules/dragrator/node_modules/selenium webdriver/lib/webdriver/webdriver.js:148
var session=flow.execute(函数(){
^
未知错误:驱动程序不可执行:PROJECT_DIR/node_modules/phantomjs/bin/phantomjs
在
在
在
在
在
在
在
在
在
在
在
在
在
在
在
在
在
在
在
在
在
==异步任务====
WebDriver.createSession()
位于Function.webdriver.webdriver.acquireSession(项目目录/节点模块/量角器/节点模块/selenium webdriver/lib/webdriver/webdriver.js:148:22)
位于Function.webdriver.webdriver.createSession(项目目录/节点模块/量角器/节点模块/selenium webdriver/lib/webdriver/webdriver.js:122:30)
在Builder.build(PROJECT_DIR/node_modules/dragrator/node_modules/selenium webdriver/Builder.js:293:22)
在LocalDriverProvider.getDriver(PROJECT_DIR/node_modules/dragrator/lib/driverProviders/local.js:121:9)
在PROJECT_DIR/node_modules/dragrator/lib/runner.js:238:41
完成时(项目目录/节点模块/量角器/节点模块/q/q.js:797:54)
在self.promiseDispatch.done(项目目录/节点模块/量角器/节点模块/q/q.js:826:30)
在Promise.Promise.dispatch(PROJECT_DIR/节点模块/量角器/节点模块/q/q.js:759:13)
在项目目录/节点模块/量角器/节点模块/q/q.js:573:44
>>
致命错误:量角器退出,代码为:1
请帮我解决这个问题。已经很晚了,但这是我的dragrator.config.js
exports.config = {
baseUrl: 'http://localhost:9001',
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
framework: 'cucumber',
specs: [
'test/features/*.feature'
],
capabilities: {
browserName: 'phantomjs',
'phantomjs.binary.path': './node_modules/karma-phantomjs-launcher/node_modules/phantomjs/bin/phantomjs',
'phantomjs.cli.args': '--web-security=false --debug=true --webdriver --webdriver-logfile=webdriver.log --webdriver-loglevel=DEBUG',
version: '',
platform: 'ANY'
},
cucumberOpts: {
require: 'test/features/steps/*_step.js',
format: 'pretty'
}
}