Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
How to access AngularJS Controller in a E2E test using Protractor

I have an AngularJS application on which I'm performing E2E tests. I want to access my web page's scope object's properties but I can't do so.

I tried doing this in two ways but both the times I got the error 'angular is not defined'

The first way I did was -

browser.executeAsyncScript(function (callback) {
  var scopes = angular.element(document.querySelectorAll('[ng-app]')).scope();
  callback(scope);
  //var scopes = angular.element(document.getElementById('nextbtn')).scope();
}).then(function (output) {
  console.log(output);
});

The second option I tried -

browser.executeScript("angular.element(document.getElementById('nextbtn')).scope().setCurrentStep({ name: 'DepProfile', inst: 0, owner: 'tp' })");

Both times the same error - 'angular not defined'. Can anyone help, what am I missing on? Why can't I access the angular modal?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda