How to Test Settings Page on Android (Complete Guide)
Testing the settings page of an Android app is crucial to ensure a seamless user experience. A faulty settings page can lead to frustrated users, negative reviews, and ultimately, a loss of revenue. C
Introduction to Settings Page Testing
Testing the settings page of an Android app is crucial to ensure a seamless user experience. A faulty settings page can lead to frustrated users, negative reviews, and ultimately, a loss of revenue. Common failures in settings pages include failed saves, incorrect defaults, and inaccessible options.
What to Test
The following test cases should be considered when testing a settings page:
- Happy path scenarios:
+ Save and retrieve user preferences
+ Validate default settings
+ Test search functionality (if available)
+ Verify sorting and filtering options (if available)
- Error scenarios:
+ Invalid input handling (e.g., invalid email or password)
+ Network error handling (e.g., failed save due to no internet connection)
+ Test behavior when a required field is left empty
- Edge cases:
+ Test settings page behavior when the app is in a background state
+ Validate settings page functionality when the device's language is changed
+ Test behavior when the device's orientation is changed
- Accessibility considerations:
+ Ensure all settings options are accessible via screen reader
+ Test high contrast mode and color inversion
+ Validate closed captions for any audio or video content
Manual Testing Approach
To manually test a settings page, follow these steps:
- Launch the app and navigate to the settings page
- Test each setting individually, ensuring it functions as expected
- Validate that changes are saved correctly and persist between app sessions
- Test error scenarios by providing invalid input or simulating network errors
- Verify accessibility features, such as screen reader compatibility and high contrast mode
Example test case:
// Test saving a user preference
public void testSavePreference() {
// Launch the app and navigate to the settings page
Intent intent = new Intent(getActivity(), SettingsActivity.class);
startActivity(intent);
// Select a setting and save the new value
onView(withId(R.id.setting_checkbox)).perform(click());
onView(withId(R.id.save_button)).perform(click());
// Verify the new value is saved
assertTrue(isSettingEnabled(R.id.setting_checkbox));
}
Automated Testing Approach
Automated testing can be achieved using frameworks like Appium or Espresso. Here's an example using Appium:
// Test saving a user preference using Appium
public void testSavePreference() {
// Launch the app and navigate to the settings page
driver.findElement(By.id("com.example.app:id/settings_button")).click();
// Select a setting and save the new value
driver.findElement(By.id("com.example.app:id/setting_checkbox")).click();
driver.findElement(By.id("com.example.app:id/save_button")).click();
// Verify the new value is saved
assertTrue(driver.findElement(By.id("com.example.app:id/setting_checkbox")).isSelected());
}
To integrate automated tests with a CI/CD pipeline, tools like GitHub Actions can be used:
# GitHub Actions workflow file
name: Android App Testing
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run Appium tests
uses: appium/action@v1
with:
test-package: com.example.app.tests
Autonomous Testing with SUSA
SUSA, an autonomous QA platform, can test a settings page without the need for manual scripts. SUSA's curious persona will test happy path scenarios, while the adversarial persona will test error scenarios. The accessibility persona will ensure that all settings options are accessible via screen reader and that high contrast mode is functioning correctly.
SUSA's cross-session learning feature allows it to get smarter about the app every run, identifying new issues and improving test coverage. The flow tracking feature provides PASS/FAIL verdicts for critical flows like login, registration, and checkout.
Example of SUSA's test results:
| Test Case | Result |
|---|---|
| Save user preference | PASS |
| Invalid input handling | PASS |
| High contrast mode | PASS |
| Screen reader compatibility | FAIL |
By using SUSA, developers can ensure their settings page is thoroughly tested, without the need for manual scripting or test maintenance. With its autonomous testing capabilities and persona-based testing, SUSA can catch issues that might be missed by manual testing, ensuring a high-quality user experience.
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