将Angular JS 1.4.x更新为Angular 2后,Selenium测试将无法通过Firefox上的grunt-protractor-runner运行.加载AngularJS后,会发生以下错误:
D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108 var template = new Error(this.message); ^ UnknownError: Permission denied to access property "toString" Build info: version: '2.48.2',revision: '41bccdd',time: '2015-10-09 19:59:12' System info: host: 'NAGWS72',ip: '192.168.210.23',os.name: 'Windows 7',os.arch: 'x86',os.version: '6.1',java.version: '1.7.0_79' Driver info: driver.version: unknown at new bot.Error (D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108:18) at Object.bot.response.checkResponse (D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:109:9) at D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:379:20 at [object Object].promise.Promise.goog.defineClass.invokeCallback_ (D:/.../node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1337:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_.execute_ (D:/.../node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2776:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_ (D:/.../node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2758:21) at goog.async.run.processWorkQueue (D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:124:15) at process._tickCallback (node.js:366:9) From: Task: <anonymous> at [object Object].pollCondition [as _onTimeout] (D:/.../node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2233:16) at Timer.listOnTimeout (timers.js:92:15) From: Task: <anonymous wait> at [object Object].promise.ControlFlow.goog.defineClass.getSchedule.indent.wait (D:/.../node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2226:17) at [object Object].webdriver.WebDriver.wait (D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:716:21) at [object Object].to.(anonymous function) [as wait] (D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\lib\protractor.js:65:25) at global.doLogin (D:\...\nisXplorerConfig.js:44:21) at exports.config.onPrepare (D:\...\nisXplorerConfig.js:79:9) at D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\lib\util.js:54:41 at Function.promise (D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\node_modules\q\q.js:650:9) at Object.exports.runFilenameOrFn_ (D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\lib\util.js:44:12) at [object Object].Runner.runTestPreparer (D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\lib\runner.js:76:17) at Object.exports.run (D:\...\node_modules\grunt-protractor-runner\node_modules\protractor\lib\frameworks\jasmine.js:89:17)
Chrome和Internet Explorer工作正常.
出现以下组件的问题:
> Firefox版本38和42
grunt-protractor-runner 2.1.0和3.0.0(使用selenium-server-standalone-2.48.2.jar)
>量角器2.5.1和3.0.0
以下节点模块正在使用(package.json):
{ "name": "...","version": "1.0.0","description": "","main": "Gruntfile.js","dependencies": { "jasmine-reporters": "^2.0.7","protractor-video-recorder": "^0.1.0" },"devDependencies": { "grunt-protractor-runner": "^3.0.0","jasmine-spec-reporter": "^2.4.0","lodash": "^3.10.1","protractor-console": "^2.0.0" },"scripts": { "test": "echo \"Error: no test specified\" && exit 1" },"author": "","license": "ISC" }
为了隔离问题,我安装了样本
Angular 2 Go with Protractor !,并且在将browserName:’chrome’更改为firefox后,得到完全相同的错误(如我的第一个注释).
原文链接:https://www.f2er.com/angularjs/143000.html