Run Smoke Tests on Multiple Android Devices with Phoma’s Visual Flow Builder
Why Visual Automation Works for Smoke Testing
Smoke tests are the first line of quality assurance for any Android app. They verify that the core user journeys—login, data entry, navigation—still work after each build. Traditional approaches require writing scripts in Appium, Espresso, or UI Automator, which can be time‑consuming and fragile when UI changes.
Phoma’s visual flow builder lets you design these smoke tests without a single line of code. By building a flow once and then running it on many devices, you get fast feedback, consistent execution, and a clear audit trail. The visual nature also makes it easy for non‑technical team members to contribute to test maintenance.
Connect Your Android Phones to Phoma
Before you can run a flow, Phoma must see the devices. You have two common connection methods:
USB Debugging
- Enable Developer Options on each phone (Settings → About → Build number, tap 7 times).
- In Developer Options, turn on USB Debugging.
- Connect the phone to your Windows PC with a USB cable.
- On the PC, open Phoma and click Add Device. Phoma will install the necessary drivers automatically (Windows Driver Installer runs silently).
- When prompted, confirm the debugging trust on the phone.
Wireless Debugging (Wi‑Fi)
- Keep USB debugging enabled for the initial pairing.
- On the phone, go to Developer Options → Wireless Debugging and turn it on.
- The PC will show a QR code or pairing code—scan it with the phone or enter the code manually.
- After pairing, disconnect the USB cable. Phoma will list the device under Wireless tab.
If a device never appears, check that the USB driver is up‑to‑date, that the phone’s OEM allows debugging (some manufacturers lock it), and that Windows Firewall isn’t blocking adb. Restarting Phoma and the phone often resolves connection hiccups.
Build a Smoke‑Test Flow in Phoma
Open Phoma and click New Flow. Give the flow a descriptive name like Login Smoke Test. The canvas shows a step list; start with the first action.
1. Launch the App
- Drag Open App from the palette.
- In the Package field, type
com.example.myapp. - In Activity, leave blank to start the main launcher activity.
- Click Add Step.
2. Wait for the Login Screen
- Add a Wait for Element step.
- Choose the selector type. Phoma offers three robust options:
1. Accessibility ID – `resource-id="com.example.myapp:id/login_button"`
2. Class Name – `className="android.widget.Button"`
3. Text – `textContains="Sign In"`
Pick Accessibility ID if the element has a stable content-desc. If the app doesn’t set it, fall back to Class Name and combine with Text for uniqueness.
- Set Timeout to 5 seconds. Click Add Step.
3. Enter Credentials
- Add a Type Text step.
- Bind it to the username field (
resource-id="com.example.myapp:id/username"). - Input
testuser. - Add another Type Text for the password field (
resource-id="com.example.myapp:id/password") withsecretText="true". - Input
TestPass123.
4. Tap the Sign‑In Button
- Add a Tap step targeting the same login button used earlier.
- Set Duration to 0.2 seconds for a quick tap.
5. Verify Successful Navigation
- Add a Wait for Element for the home screen (
resource-id="com.example.myapp:id/home_title"). - If the element appears, the flow continues; otherwise, it stops and marks the step as failed.
6. Capture Evidence
- Insert a Screenshot step.
- Name it
login_success.png. This screenshot is saved to the phone’s storage and attached to the run log.
7. (Optional) Perform a Simple Assertion
- Use Read Text on the home title element, then a Assert Text step.
- Example:
Assert Text equals "Welcome". This adds a deterministic pass/fail signal without writing code.
Save the flow. At this point you have a reusable smoke‑test that can be edited later without breaking existing runs.
Selecting Elements That Survive App Updates
UI changes are inevitable. To future‑proof your flow:
- Prefer Accessibility IDs whenever the app sets them; they are less likely to be renamed than resource IDs.
- Use Class + Text combinations:
className="android.widget.EditText"+textContains="Username". Even if the resource ID changes, the edit text with that label stays. - Avoid hard‑coded indices (e.g.,
listItem[0]). Instead, wait for a unique element within the list. - After each app update, run the flow on a single device. Phoma will show which step failed; you can then adjust the selector using the Element Picker—a visual overlay that highlights matching nodes in real time.
Run the Flow on Many Phones at Once
Phoma’s Batch Run feature makes it trivial to execute the same flow on multiple devices:
- In the Flows list, select your smoke‑test flow.
- Click Run → Batch Run.
- Choose Devices and tick each phone you want to test.
- Toggle Run in Parallel (default) to start all devices simultaneously.
- Set a Start Delay (e.g., 2 seconds) to avoid thundering‑herd issues on Wi‑Fi networks.
- Click Start.
Each device runs the flow independently, logging results to its own run history. The Runs view aggregates outcomes: you see a green check for devices that passed, red X for failures, and a link to the screenshot for each failed step.
Schedule Automated Smoke Tests
For continuous integration, schedule runs at specific times or after each build:
- Open the flow, click the Schedule icon (clock).
- Define a Cron‑like schedule: e.g.,
0 9 * * 1-5(weekdays at 9 AM). - Choose Time Zone matching your team’s location.
- Select the target device group (or all devices).
- Enable Notify on Failure and add an email or Slack webhook.
Scheduled runs respect the phone’s power state; Phoma will wake the device, run the flow, and then put it back to sleep, minimizing battery drain.
Share Flows and Devices Within a Team
If you need collaborative maintenance, upgrade to Phoma’s Team plan. Steps:
- In Phoma, go to Team → Share Flow.
- Enter team members’ email addresses.
- Set permissions: Edit (full control) or Run (execute only).
- For devices, use Device Groups to bundle phones by environment (e.g., “QA Lab”, “Staging”).
- Members can now view, copy, or modify shared flows without overwriting the original.
Versioning is implicit: each edit creates a new snapshot, and you can roll back to a previous version if a change introduces regressions.
Troubleshooting Common Issues
| Symptom | Likely Cause | Quick Fix |
|---|---|---|
| Device never appears | USB debugging disabled or driver missing | Re‑enable debugging, reinstall Windows driver via Phoma’s Device Manager tab |
| Flow fails at Wait for Element | Selector outdated after UI change | Open Element Picker, select a new matching element, update selector |
| Batch run stops early | One device runs out of battery | Ensure devices are charged; add a Power Check step before critical actions |
| Scheduled run doesn’t start | Phoma service not running or Windows sleep mode | Set Windows to keep Phoma running as a background service; disable “Let Windows turn off devices to save power” for the PC |
If a flow repeatedly fails, capture a Debug Run: Phoma records the exact screen content and element tree for each step. Compare this with the live app to spot mismatches.
Best Practices for Reliable Smoke Tests
- Keep flows small (≤ 10 steps). Smaller tests are easier to read, maintain, and debug.
- Use explicit waits (
Wait for Element) rather thanSleepnodes; they adapt to network latency. - Capture screenshots after each critical action; visual evidence speeds up root‑cause analysis.
- Avoid complex gestures (e.g., multi‑finger swipes) unless you have a fallback selector.
- Document the purpose of each step in the flow’s description field; this helps new team members understand intent.
- Run a smoke test on a fresh device before committing to a schedule; this ensures the flow works on a clean install and with varied OS versions.
By following these practices, you’ll get consistent smoke‑test results across your device fleet, reduce manual QA overhead, and keep your app’s quality high.
Conclusion
Phoma’s visual flow builder turns multi‑device smoke testing into a drag‑and‑drop experience. You can connect phones via USB or Wi‑Fi, design robust element selectors, and run the same flow on dozens of devices in parallel or on a schedule. Team sharing lets QA, developers, and operations collaborate without code, while built‑in troubleshooting tools keep failures visible and actionable.
Start by creating a single login smoke test as outlined above. Scale it out to your whole testing lab, and watch your feedback loop tighten—without writing a single line of automation script.
Ready to automate your smoke tests? Download Phoma today and import the sample flow used in this guide.
