alecxe alecxe - 1 year ago 88
Javascript Question

Failed: Cannot read property 'all' of undefined

We have been using

protractor.promise.all([promise1, promise2, promise3])
extensively to resolve multiple promises up until the upgrade to Protractor 4.0.0.

Now, it is failing with:

Failed: Cannot read property 'all' of undefined

What should we use instead of
, or is this a bug?

Answer Source

In version 4.0.0, the function protractor.promise.all is no longer present in the protractor.promise namespace:

It is just a shortcut to the promise namespace from the Selenium library. So as an alternative:

var promise = require('selenium-webdriver').promise;

promise.all([promise1, promise2, promise3])
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download