How to use Protractor with Angular 2?

You can test Angular 2 applications with Protractor (starting from Protractor 2.5.0).

For Protractor 5.0.0+, you don’t have to do anything specific, Protractor will auto-detect the Angular version used in the application under test.

For Protractor >= 2.5.0 and <= 4.0.14, you would only need to add useAllAngular2AppRoots: true to your config. Here is a sample.


Note that several built-in Protractor matchers would not yet work with Angular2, see:

  • Protractor Angular 2 Failed: unknown error: angular is not defined

There is also that Protractor+Angular2 problem in Firefox (still unresolved), see:

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)