mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
How to using WireMock.NET with Appium to mock mobile app response #364
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vfongmala-willowinc on GitHub (Oct 7, 2021).
I have a mobile app which is pointing to real URL (with HTTPS).
I run an automation test on the app by using Appium framework.
I want to intercept the response from real URL with the mock data without changing the URL on the app.
What would be the correct configuration to start the server?
What I've tried.
However, it doesn't seems to work as I expect. Emulator couldn't connect to WireMock server and couldn't connect to the real server either.
@leolplex commented on GitHub (Oct 7, 2021):
Hi @vfongmala-willowinc,
You could take a look over it,Proxying
I think you should change the URL in the app for http://localhost:777 that is the WireMock.Net service then, if all will be working you should see an auto generate file with a name (GUID) in
__admin/mappingsAfter you mock it, then you should run again the wiremock.net server but with this config:
Finally you will be able to use the mock data in the URL "http://localhost:777".
@vfongmala-willowinc commented on GitHub (Oct 7, 2021):
Hi @leolplex
Can I do the mock server without recording and mapping?
And Can I do it without changing app URL to localhost?
I already have mock data for responses. And I just want to make the responses of it.
@leolplex commented on GitHub (Oct 10, 2021):
Hi @vfongmala-willowinc
Yes you can mock server without recording and mapping but you need keep the WireMockDotNet standar.
I don't know how mock without changing app URL.
Take a look over this WireMock.Net structure.
@Vadym1123456 commented on GitHub (Oct 25, 2021):
Hi @leolplex, сan I use wiremock as a proxy I need to skip all requests to the real server but while researching all requests and answers, in order to get the right answer coming to the phone I replaced the data, as it is done in the Charles program?
@StefH commented on GitHub (Sep 19, 2022):
I'm closing this issue for now.
If there are any Appium specific steps to take, I can create a new WIKI page, but I think that the general idea on how to use WireMock.Net is the same for all integrations.
Else, please create a new issue with a wiki-page proposal on this topic.