How to Test Error Handling on Android (Complete Guide)

Error handling testing is a critical aspect of ensuring the quality and reliability of Android apps. When an app fails to handle errors properly, it can lead to a poor user experience, resulting in ne

February 20, 2026 · 3 min read · How-To Guides

Introduction to Error Handling Testing

Error handling testing is a critical aspect of ensuring the quality and reliability of Android apps. When an app fails to handle errors properly, it can lead to a poor user experience, resulting in negative reviews, low ratings, and ultimately, a loss of users. Common failures in error handling include unhandled exceptions, crashes, and ANR (Application Not Responding) errors, which can occur due to various reasons such as network issues, invalid user input, or unexpected system states.

What to Test

To ensure robust error handling, you should test the following scenarios:

+ Successful login and registration

+ Successful payment processing

+ Successful data retrieval from servers

+ Invalid user credentials

+ Network connectivity issues

+ Server-side errors (e.g., 500 Internal Server Error)

+ Invalid or missing data

+ Low battery or storage conditions

+ Screen rotation or orientation changes

+ Multitasking or background execution

+ Screen reader compatibility for visually impaired users

+ High contrast mode for users with visual impairments

+ Error messages and alerts should be accessible via accessibility services

Some specific test cases to consider:

  1. Invalid login credentials: Enter incorrect username or password and verify that the app displays an error message.
  2. Network connectivity issues: Test the app's behavior when the network connection is lost or unstable.
  3. Server-side errors: Simulate server-side errors (e.g., 500 Internal Server Error) and verify that the app handles them correctly.
  4. Low battery conditions: Test the app's behavior when the battery level is low (e.g., 10%).
  5. Screen rotation: Test the app's behavior when the screen is rotated or the orientation is changed.
  6. Multitasking: Test the app's behavior when it is running in the background or when the user switches between apps.
  7. Error messages and alerts: Verify that error messages and alerts are accessible via accessibility services.
  8. Screen reader compatibility: Test the app's compatibility with screen readers for visually impaired users.

Manual Testing Approach

To manually test error handling on an Android app, follow these steps:

  1. Prepare test cases: Identify the test cases you want to execute, such as the ones mentioned earlier.
  2. Set up the test environment: Ensure you have a physical or virtual Android device with the app installed.
  3. Execute test cases: Manually execute each test case and verify the app's behavior.
  4. Report defects: Document any defects or issues found during testing.

Example of how to simulate a network connectivity issue using Android's adb command:


# Disable network connectivity
adb shell svc wifi disable
adb shell svc data disable

# Enable network connectivity
adb shell svc wifi enable
adb shell svc data enable

Automated Testing Approach

To automate error handling testing on Android, you can use tools and frameworks such as:

Example of how to write an automated test using Appium and Java:


import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;

// Set up the Appium driver
AndroidDriver<AndroidElement> driver = new AndroidDriver<>(new URL("http://localhost:4723/wd/hub"), capabilities);

// Test case: Invalid login credentials
driver.findElement(By.id("username")).sendKeys("invalid_username");
driver.findElement(By.id("password")).sendKeys("invalid_password");
driver.findElement(By.id("login_button")).click();

// Verify error message
Assert.assertTrue(driver.findElement(By.id("error_message")).getText().contains("Invalid username or password"));

How SUSA Tests Error Handling Autonomously

SUSA, an autonomous QA platform, can test error handling on Android apps using its 10 user personas, including:

SUSA can catch issues such as:

SUSA can also auto-generate Appium and Playwright regression test scripts, allowing you to integrate automated testing into your CI/CD pipeline. Additionally, SUSA provides WCAG 2.1 AA accessibility testing and OWASP Top 10 security testing to ensure your app meets the latest accessibility and security standards.

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free