Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot call method 'getCapabilities' of undefined #9

Closed
hco opened this issue Apr 10, 2015 · 5 comments
Closed

Cannot call method 'getCapabilities' of undefined #9

hco opened this issue Apr 10, 2015 · 5 comments

Comments

@hco
Copy link

hco commented Apr 10, 2015

I get the above error after running my tests. I'm not sure if it's a duplicate of #4, and I'm sorry if it is :)
I currently have two tests, and for one of them a screenshot is being generated. Full trace below.

My protractor config looks like this:

exports.config = {
  framework: 'jasmine2',
  mocks: {
    default: ['Generic/Profile'],
    dir: 'tests/mocks'
  },
  onPrepare: function() {
    var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
    jasmine.getEnv().addReporter(new HtmlScreenshotReporter({
      dest: 'protractorScreenshots'
    }));
  },
  specs: ['tests/e2e/**/*.spec.js']
};
TypeError: Cannot call method 'getCapabilities' of undefined
    at /Users/hco/src/foobar/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:430:20
    at promise.ControlFlow.runInFrame_ (/Users/hco/src/foobar/node_modules/selenium-webdriver/lib/webdriver/promise.js:1877:20)
    at promise.Callback_.goog.defineClass.notify (/Users/hco/src/foobar/node_modules/selenium-webdriver/lib/webdriver/promise.js:2464:25)
    at promise.Promise.notify_ (/Users/hco/src/foobar/node_modules/selenium-webdriver/lib/webdriver/promise.js:563:12)
    at Array.forEach (native)
    at Object.goog.array.forEach (/Users/hco/src/foobar/node_modules/selenium-webdriver/lib/goog/array/array.js:203:43)
    at promise.Promise.notifyAll_ (/Users/hco/src/foobar/node_modules/selenium-webdriver/lib/webdriver/promise.js:552:16)
    at goog.async.run.processWorkQueue [as _onTimeout] (/Users/hco/src/foobar/node_modules/selenium-webdriver/lib/goog/async/run.js:125:21)
    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
From: Task: WebDriver.manage().timeouts().setScriptTimeout(11000)
    at [object Object].webdriver.WebDriver.schedule (/Users/hco/src/foobar/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:360:15)
    at [object Object].webdriver.WebDriver.Timeouts.setScriptTimeout (/Users/hco/src/foobar/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:1367:23)
    at [object Object].Runner.createBrowser (/Users/hco/src/foobar/node_modules/protractor/lib/runner.js:181:30)
    at /Users/hco/src/foobar/node_modules/protractor/lib/runner.js:257:21
    at _fulfilled (/Users/hco/src/foobar/node_modules/protractor/node_modules/q/q.js:797:54)
    at self.promiseDispatch.done (/Users/hco/src/foobar/node_modules/protractor/node_modules/q/q.js:826:30)
    at Promise.promise.promiseDispatch (/Users/hco/src/foobar/node_modules/protractor/node_modules/q/q.js:759:13)
    at /Users/hco/src/foobar/node_modules/protractor/node_modules/q/q.js:573:44
    at flush (/Users/hco/src/foobar/node_modules/protractor/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:419:13)
@mlison
Copy link
Owner

mlison commented Apr 20, 2015

This actually doesn't seem to be related to #4.
The stack doesn't even trace to this npm module - checkout your webdriver. You might want to use the one that comes as a dependency with protractor module (node_modules/protractor/bin/webdriver_manager)

@mlison mlison closed this as completed Apr 20, 2015
@luciformed
Copy link

actually it does seem to be a problem with this module, I experience the same error but only when I add the screenshot reporter

guy-mograbi-at-gigaspaces added a commit to cloudify-cosmo/getcloudify-widget-selenium-tests that referenced this issue Aug 3, 2015
@Nikhil0538
Copy link

What's the solution for this?

@mlison
Copy link
Owner

mlison commented Mar 28, 2016

I haven't heard anyone mention this one after updating to latest protractor + reporter setup.

@Nikhil0538 if you're still experiencing trouble with this one, could you please open up a new issue and describe your setup and errors you're getting?

@Nikhil0538
Copy link

I have made a work around using "process.nextTick(callback[, arg][, ...])".

Thanks for reaching me out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants