Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8462181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:05:49+00:00 2026-06-10T14:05:49+00:00

I want to write automated tests to run on the emulator that verify that

  • 0

I want to write automated tests to run on the emulator that verify that my app behaves correctly when the network connection is spontaneously dropped. To do so, I’d like to write tests like the following:

  1. Enable network connection.
  2. Start some app network operation such as a long file download.
  3. Disable network connection.
  4. Verify that lost network connection dialog is shown.

I have seen various stackoverflow answers that address this by suggesting manually disabling the network connection from the host PC via the command line. This cannot be not automated by a test that is running on the emulator, because the emulator has no access to its host PC. And running the commands in a host PC shell script would be very difficult to attempt to automatically synchronize with an emulator test.

Alternately I’ve seen answers that suggest manipulating the emulator’s network settings, which apparently don’t actually disable access, they only cause explicit connectivity checks like networkInfo.isConnected() to report a disconnected state. They still allow bidirectional communication. (E.g., when emulator network access is disabled, the browser is still fully functional.)

Has anyone been able to construct automated tests that run on the emulator and actually turn on and off network access as needed mid-test?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:05:50+00:00Added an answer on June 10, 2026 at 2:05 pm

    There is presently no way to truly disable network access programmatically from within a unit test. I filed an enhancement request for this issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an app that's destined for the browser, and I want to write
I want to write a program in Prolog that confirms if a b-tree of
I am trying to write some automated unit tests for a series of functions
I would like to write some scripts in python that do some automated changes
I want to write a python script (Yes not Bash) that will use flac
I use Visual Studio 2008 Professional automated tests. I have a function that writes
We need to write some automated UI Tests on a project which is done
I want to write a simple automated test to determine if a .ts video
I want to write a script in AutoIt, which can take automatic input from
I want write a simple query which will fetch data from a table (which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.