S Pat
S Pat

Reputation: 409

How to get the browser API calls using Protractor?

I Need to verify if the required API is been triggered by the browser or not. So, is there a way to get the list of API's that been called by the browser using Protractor?

Upvotes: 3

Views: 796

Answers (2)

Segg3r
Segg3r

Reputation: 466

Usually you want to check if any of REST calls were performed in unit tests. You can use $httpBackend Anguler module for it.

Upvotes: 0

P.T.
P.T.

Reputation: 25177

There is nothing in Protractor or webdriver that I am aware of that will help with this (both of these mostly deal with the front end of the browser, not the server-facing end). Depending on which browser you are using you may be able to ask it, or install a plugin (E.g., How do I make the web browser log all activity, including requests, responses, cookie activity, to a log file that I can inspect?).

Upvotes: 1

Related Questions