Mugen Mugen - 17 days ago 5
JSON Question

Mock GET http requests for a web app when testing using Selenium

I have an

AngularJS
application and I'm using
Selenium
to do UI testing using
C#
.

My web app is sending GET requests to a specific server (say
http://localhost:8082
).

What would be the best way to mock the response of these requests? I don't want my server to run for these tests, and also for testing purposes it would be best to setup the returned JSON.

Answer

one way to do it is with fiddler- all you need to do is setting fiddler as a proxy, and configure an auto responder. take a look at: http://stackoverflow.com/a/32812386/1447518

Comments