Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run Selenium via Protractor on Firefox after update to Angular 2

After updating Angular JS 1.4.x to Angular 2, Selenium tests can't run anymore via grunt-protractor-runner on Firefox. As soon as AngularJS is loaded, the following error occurs:

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 and Internet Explorer work fine.

The problem appears with the following components:

  • Firefox version 38 and 42
  • grunt-protractor-runner 2.1.0 and 3.0.0 (which uses selenium-server-standalone-2.48.2.jar)
  • protractor 2.5.1 and 3.0.0

The following node modules are in use (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"
}

There is no code part in the Selenium test, which can be localized to produce the error. The error appears just at the moment when AngularJS is loaded.

like image 966
gogol Avatar asked Dec 11 '15 10:12

gogol


People also ask

What browsers work with Protractor?

Protractor supports the two latest major versions of Chrome, Firefox, Safari, and IE. These are used in Protractor's own suite of tests.

Does Protractor require Selenium?

Protractor can test directly, without the use of Selenium Server, against Chrome and Firefox by setting directConnect: true in config file.

Which driver is used for Firefox automation in Selenium?

Why GeckoDriver is used? After version 47, Mozilla Firefox came out with Marionette, which is an automation driver. It remotely controls either the UI or the internal JavaScript of a Gecko platform, such as Firefox. Hence, we require GeckoDriver for Firefox.


1 Answers

To isolate the problem I installed the sample Angular 2 Go with Protractor ! and got exactly the same error (as in my first comment) after I changed browserName: 'chrome' to firefox.

Thus I created a new issue on Protractors github page.

like image 67
gogol Avatar answered Sep 30 '22 20:09

gogol