Automating Accessibility Testing with Phoma
Introduction
Accessibility testing ensures your Android app is usable by people with disabilities. Manual testing can be time‑consuming and easy to miss. Phoma lets you build visual flows that automatically check accessibility properties like content descriptions, labels, and hints on every screen — no coding required.
In this guide you will create a reusable accessibility audit flow that:
- Opens your app.
- Navigates through key screens.
- Verifies that every interactive element has a content description or label.
- Flags missing or empty accessibility text.
- Takes screenshots and writes a simple report.
You can run the flow on a single phone or on a fleet of devices, and schedule it to run after every build.
Prerequisites
- A Windows PC with Phoma installed.
- At least one Android phone with USB debugging enabled (or wireless debugging set up).
- The app you want to test installed on the phone.
- Basic familiarity with Phoma’s flow builder (tap, swipe, wait, etc.).
Step 1: Understand the Accessibility Tree
Android exposes a semantic tree called the accessibility tree. Every view that can be interacted with (buttons, text fields, images) has properties such as:
- contentDescription – spoken label for screen readers.
- text – visible text.
- hint – placeholder or guidance.
- className – the type of view (e.g.,
android.widget.Button).
Phoma reads this tree to identify elements. When you use “Tap on element” or “Read text”, Phoma shows you all nodes with their accessibility attributes.
Tip: Open your app, go to Settings → Accessibility → TalkBack (or similar), and enable it. Then open the Phoma screen mirroring and double‑tap any button to see its accessibility properties in the overlay.
Step 2: Build the Audit Flow
Create a new flow named “Accessibility Audit”.
2.1 Open the App
Add an Open App step and select your app from the list.
2.2 Navigate to the First Screen
If the app shows a splash or onboarding, add a Wait for element step (e.g., “Skip” button) and then Tap to dismiss it. Use the Screenshot step to capture the screen for later reference.
2.3 Check Every Interactive Element
Phoma does not have a built‑in “check all elements” action, but you can simulate it by:
- Read the layout – Use Get element tree (or similar) to dump all nodes. Phoma can store this as a text variable.
- Loop through nodes – Add a For each loop that iterates over the list of nodes. Inside the loop:
- Read contentDescription (or
accessibilityText). - Condition: If the field is empty or missing, mark the test as failed.
- Log the node’s className and the missing description.
- Read contentDescription (or
Example loop logic (conceptual):
For each node in elementTree: if node.isInteractive and (node.contentDescription == "" or node.contentDescription == null): fail("Missing contentDescription on " + node.className) screenshot()
You can build this visually using Phoma’s Condition and Loop blocks.
2.4 Verify Specific Landmarks
Not every element needs a contentDescription (e.g., decorative images). Add a Condition to skip elements with className = "android.widget.Image" and contentDescription = "decorative".
Step 3: Handle Dynamic Content
Some screens load data from the network. Add a Wait for element step with a timeout before checking the tree. If the content is still loading, the flow can retry or skip that screen.
Use HTTP Request steps to fetch test data if your app uses a backend. Then Type text or Tap to populate fields and verify that the dynamically generated labels are correct.
Step 4: Multi‑Screen Coverage
To audit the whole app:
- Record a macro of typical user journeys (e.g., login → browse → checkout).
- Insert the macro at the beginning of the flow.
- After each macro step, insert the element‑check loop from Step 2.
You can also create sub‑flows for common sections (settings, profile, etc.) and reuse them.
Step 5: Reporting and Scheduling
5.1 Capture Evidence
Add a Screenshot step after each failed check. Phoma will attach the image to the flow run log.
5.2 Export Results
Use the HTTP Request step to POST a summary (number of failures, screenshots) to a webhook or a simple Google Sheet. Phoma can send JSON data; you can map each field to a column.
5.3 Schedule the Flow
In the flow’s settings, enable Schedule. Choose a daily time or trigger it after a new build is uploaded. Phoma will run the flow on all assigned phones and email the report.
Real‑World Example
A banking app needed to pass an accessibility audit. The team built a flow that:
- Logs in.
- Navigates to the transfer screen.
- Checks that the “Amount” input field has a
hint. - Verifies the “Send” button has a contentDescription.
- Loops through all transaction rows to ensure each status label is readable.
The flow caught three missing labels that manual testing missed.
Best Practices
- Start small: Audit one screen first, then expand.
- Use descriptive selectors: Prefer text or contentDescription over raw resource IDs, because IDs can change.
- Keep flows modular: A sub‑flow for “check accessibility of a list” can be reused.
- Run on multiple devices: Different screen sizes may expose missing labels.
Conclusion
Accessibility testing no longer has to be a manual chore. With Phoma you can build a visual flow that automatically verifies accessibility properties across your app, runs on every device, and reports issues with screenshots. Try it on a single screen today, then scale to your whole app.
Phoma runs on your own phones and computer. No cloud, no per‑device fees. Team and Business plans add shared phones and flows for larger groups.
