[{"data":1,"prerenderedAt":24},["ShallowReactive",2],{"blog-post-en-automating-accessibility-testing-with-phoma":3},{"slug":4,"lang":5,"title":6,"summary":7,"date":8,"tags":9,"tag_slugs":15,"thumbnail_url":20,"translations":21,"body":22,"asset_base":23},"automating-accessibility-testing-with-phoma","en","Automating Accessibility Testing with Phoma","Learn how to use Phoma to automate accessibility testing for your Android app, verifying content descriptions, labels, and accessibility properties without writing code.","2026-11-15",[10,11,12,13,14],"accessibility testing","phoma","android automation","qa testing","accessibility tree",[16,11,17,18,19],"accessibility-testing","android-automation","qa-testing","accessibility-tree","https://blog-api.phomaapp.com/api/blog/posts/automating-accessibility-testing-with-phoma/thumbnail.svg?lang=en",[5],"## Introduction\n\nAccessibility 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.\n\nIn this guide you will create a reusable accessibility audit flow that:\n\n- Opens your app.\n- Navigates through key screens.\n- Verifies that every interactive element has a content description or label.\n- Flags missing or empty accessibility text.\n- Takes screenshots and writes a simple report.\n\nYou can run the flow on a single phone or on a fleet of devices, and schedule it to run after every build.\n\n## Prerequisites\n\n- A Windows PC with Phoma installed.\n- At least one Android phone with USB debugging enabled (or wireless debugging set up).\n- The app you want to test installed on the phone.\n- Basic familiarity with Phoma’s flow builder (tap, swipe, wait, etc.).\n\n## Step 1: Understand the Accessibility Tree\n\nAndroid exposes a semantic tree called the **accessibility tree**. Every view that can be interacted with (buttons, text fields, images) has properties such as:\n\n- **contentDescription** – spoken label for screen readers.\n- **text** – visible text.\n- **hint** – placeholder or guidance.\n- **className** – the type of view (e.g., `android.widget.Button`).\n\nPhoma reads this tree to identify elements. When you use “Tap on element” or “Read text”, Phoma shows you all nodes with their accessibility attributes.\n\n> **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.\n\n## Step 2: Build the Audit Flow\n\nCreate a new flow named “Accessibility Audit”.\n\n### 2.1 Open the App\n\nAdd an **Open App** step and select your app from the list.\n\n### 2.2 Navigate to the First Screen\n\nIf 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.\n\n### 2.3 Check Every Interactive Element\n\nPhoma does not have a built‑in “check all elements” action, but you can simulate it by:\n\n1. **Read the layout** – Use **Get element tree** (or similar) to dump all nodes. Phoma can store this as a text variable.\n2. **Loop through nodes** – Add a **For each** loop that iterates over the list of nodes. Inside the loop:\n   - **Read contentDescription** (or `accessibilityText`).\n   - **Condition:** If the field is empty or missing, mark the test as failed.\n   - **Log** the node’s className and the missing description.\n\n> **Example loop logic (conceptual):**\n> \n>     For each node in elementTree:\n>         if node.isInteractive and (node.contentDescription == \"\" or node.contentDescription == null):\n>             fail(\"Missing contentDescription on \" + node.className)\n>             screenshot()\n\nYou can build this visually using Phoma’s **Condition** and **Loop** blocks.\n\n### 2.4 Verify Specific Landmarks\n\nNot every element needs a contentDescription (e.g., decorative images). Add a **Condition** to skip elements with `className = \"android.widget.Image\"` and `contentDescription = \"decorative\"`.\n\n## Step 3: Handle Dynamic Content\n\nSome 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.\n\nUse **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.\n\n## Step 4: Multi‑Screen Coverage\n\nTo audit the whole app:\n\n1. Record a **macro** of typical user journeys (e.g., login → browse → checkout).\n2. Insert the macro at the beginning of the flow.\n3. After each macro step, insert the **element‑check loop** from Step 2.\n\nYou can also create **sub‑flows** for common sections (settings, profile, etc.) and reuse them.\n\n## Step 5: Reporting and Scheduling\n\n### 5.1 Capture Evidence\n\nAdd a **Screenshot** step after each failed check. Phoma will attach the image to the flow run log.\n\n### 5.2 Export Results\n\nUse 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.\n\n### 5.3 Schedule the Flow\n\nIn 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.\n\n## Real‑World Example\n\nA banking app needed to pass an accessibility audit. The team built a flow that:\n\n- Logs in.\n- Navigates to the transfer screen.\n- Checks that the “Amount” input field has a `hint`.\n- Verifies the “Send” button has a contentDescription.\n- Loops through all transaction rows to ensure each status label is readable.\n\nThe flow caught three missing labels that manual testing missed.\n\n## Best Practices\n\n- **Start small:** Audit one screen first, then expand.\n- **Use descriptive selectors:** Prefer text or contentDescription over raw resource IDs, because IDs can change.\n- **Keep flows modular:** A sub‑flow for “check accessibility of a list” can be reused.\n- **Run on multiple devices:** Different screen sizes may expose missing labels.\n\n## Conclusion\n\nAccessibility 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.\n\n---\n\n*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.*\n","https://blog-api.phomaapp.com/api/blog/posts/automating-accessibility-testing-with-phoma/assets",1796035640084]