Fix your Tests - Best Practices - Sofy Support Docs: No-Code Automation Testing Platform Help

Fix your Tests - Best Practices

Updated 1 year ago by Kashif Hussain

Reference This Guide to Maximize Test Debugging Efficiency

Understanding Test Results Statuses

All steps executed successfully without any issues. Accessible
Test case passed with minor issues (e.g., retries, slow load times). Accessible
One or more steps failed due to functional/UI errors. Accessible
Tests did not complete (e.g., crash, timeout, or manual stop). Not Accessible
Tests did not start. Not Accessible

Before Fixing, Always Verify the Root Cause

Review Test Run Result

Access Detailed Reports: Utilize Sofy's Lab Run or Scheduled Run views to access comprehensive reports, including step-by-step execution details, screenshots, and logs.

Identify Failure Points: Look for steps marked as failed or with warnings. Sofy's visual indicators (e.g., red crosses for failures) help pinpoint problematic steps quickly.

Analyze Failure Reasons: Review the 'Reason(s)' section to understand why a test failed—be it due to missing elements, incorrect actions, or unexpected UI changes.

Utilize Debugging Tools

Compare to Recording: Use this feature to juxtapose the current test run with the baseline recording, highlighting any deviations in UI or behavior.

Element Explorer: Element Explorer allows you to inspect UI elements' properties, such as class names, resource IDs, and hierarchy. This aids in verifying if the correct elements were interacted with during the test.

Reproduce the Failure Manually

Validating the failure manually ensures it's not a false positive:

Replicate Test Steps: Run the Test case in the lab on the same build as used in schedule run to see if the issue persists.

Check for Intermittent Issues: Some failures might be due to transient issues like network latency or temporary glitches. Reproducing the test helps confirm the consistency of the failure.

Identify Common Failure Causes

Apply Targeted Fixes

Enhance Test Stability

Flaky tests are those that fail sometimes and pass other times without any code or test change. They reduce trust in automation and increase debug time. In mobile apps, flakiness is often caused by timing issues, network delays, or dynamic elements.

Best Practices to Reduce Flakiness