Reputation: 692
When importing protrator in an Angualr application I try to use the function browser.waitForAngularEnabled
.
When I run the code I get the error:
E/launcher - Error: TypeError: Cannot read property 'waitForAngularEnabled' of undefined
I am importing the browser in this way
const { browser } = require('protractor');
When I click through to the protractor module in VS code I can see the browser object in there but in runtime this error is thrown.
Upvotes: 0
Views: 629
Reputation: 8652
In Protractor, you are provided with a global browser object. So you don't need to require it, the browser object is accessible without requiring it.
Solution: Just remove the require and it will work.
Note: You have to import it only if you are working with typescript.
Upvotes: 1