This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 7
Sep 2018

Hello All,
I am trying to mock the API responses so that I can cover over a range of test scenarios.
However i am seeing post over internet that what I am trying is impossible to achieve.
Have anyone you have managed to mock the responses? If so please let me the know the solution
It will be a BIG help… thanks in advance

  • created

    Sep '18
  • last reply

    Sep '18
  • 6

    replies

  • 326

    views

  • 3

    users

  • 1

    link

What API calls are you trying to mock the responses to? If it’s your app, you’ll have to use a third-party proxy and set that up outside of appium.

Thanks got getting back. I am trying to mock the REST API calls in android.
Tried using okhttp3 mock webserver. The mockwebserver setup without any issues. However the calls doesn’t look like they are being intercepted. Tried setting up the end points in the app to point to local host which in android is 10.0.2.2 . That too doesn’t look like its working.
Running out of ideas. Do you have any suggestions like if there are other framework for mocking api responses for automation

Thanks for the reply…
Having Charles proxy is great. However for a test suite to run faster I was looking down to cut the corners by mocking the response within the test suite itself using okhttp3 mock webserver for android. Do you have any suggestions?