Lots of folks use WireMock for Android testing. Definitely worth checking out Sam Edwards' blog and conference presentations on this, e.g. https://handstandsam.com/2016/01/30/running-wiremock-on-andr...
* The back-end API you depend on isn't ready yet
* The back-end test server is slow, flakey etc.
* You want to test scenarios you can't easily make happen on demand like slow responses, 503 errors, dropped connections etc.
Worth mentioning that even if you're not driving WireMock from Java (or another language binding), you can run it on your laptop or a server from a bunch of JSON files. This makes it usable with e.g. iOS apps.
Alternatively you can use https://www.mocklab.io, which is 100% compatible, but hosted, has a UI etc.
In particular, this is useful if you will eventually be consuming web services which do not yet exist. You can quickly mock up some JSON/XML responses and hit them using real HTTP request and response.
I worked on one project where we used Wiremock extensively. Development and QA was done against the mocks because the real target system did not exist yet. Everything from business logic to error handling and even load testing was done against wiremock. Even when the other system got up and running, some conditions were impossible to test without wiremock. For example, what if the web service we hit returns a 500 error? Well, the real system never did that in practice. But with wiremock we could do that whenever we wanted.
Of course, we still had to do integration testing before going live, but wiremock saved us a TON of time for development and QA.
Wouldn't this be frontend discovery/development, rather than frontend testing? In this case, I recognize the tool can be useful.
"For example, what if the web service we hit returns a 500 error?"
Isn't this what development and staging environments are for? Not trying to be polemic/destructive, I just see building and maintaining mock api templates as a further overhead, when specific backend behavior can be simulated in an alternative deployment environment once a backend is in fact there. But maybe I don't fully understand the constraints posed by workflows other than mine! :-)
Imagine writing a front-end to a third party weather API: recording gets you repeatable examples and slightly edited copies of those recordings allow you to check unobserved extremes without manually mocking out the whole thing.