How to using WireMock.NET with Appium to mock mobile app response
See original GitHub issueI 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.
- I set Android emulator proxy to my local machine IP address with port 7777
- I setup the WireMock server like this
_server = WireMockServer.Start(new WireMockServerSettings()
{
Urls = new[] { "https://<real url>:443"},
Port = 7777,
Logger = new WireMockConsoleLogger(),
});
- I didn’t have any specific certificate setup for HTTPS. Do I need one?
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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Android and iOS App testing with Appium and WireMock
Basic examples of integrated mock testing with Wiremock in an Appium java UI test ... app, you can enable proxying and recording using...
Read more >Appium — Adding wiremock and arguments | by Talya Zrihen
Appium — Adding wiremock and arguments · 1 · the response you want to record is https — you will need to generate...
Read more >Wiremock Tutorial: Introduction To The Wiremock Tool
It's simply a mock server that is highly configurable to return an expected response for a given request. It is widely used during...
Read more >API mocking in C# with WireMock.Net
Defining and testing a first mock API response. After adding WireMock.Net to your project using the NuGet package, using WireMock.Net to mock an...
Read more >Android App api testing with mock
It should be realtively easy to setup a server that behaves as your API, but always returns the same values so you can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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?