O'Reilly logo

Angular Test-Driven Development - Second Edition by Md. Ziaul Haq

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pausing and debugging

To debug any test spec, we must pause the test process and see what is going on step-by-step. Protractor also has built-in methods to pause the process. Here are two methods to pause and debug the test process:

  • browser.pause()
  • browser.debugger()

Using pause

Debugging Protractor tests becomes easy and simple with the browser.pause() command. Using the pause() method, we can enter the Protractor debugger control flow and execute some commands to check out what's happening in the control flow of the test. Mostly, developers use debuggers in tests when the test fails with an unknown error and there are long error messages.

After using the browser.pause() command, we can use a few more commands based on our needs.

Let's take a brief ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required