question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to using WireMock.NET with Appium to mock mobile app response

See original GitHub issue

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.

  1. I set Android emulator proxy to my local machine IP address with port 7777
  2. I setup the WireMock server like this
_server = WireMockServer.Start(new WireMockServerSettings()
{
    Urls = new[] { "https://<real url>:443"},
    Port = 7777,
    Logger = new WireMockConsoleLogger(),
});
  1. 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:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
StefHcommented, 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.

0reactions
Vadym1123456commented, 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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found