Saving Test Data to Make Debugging Easier

June 13, 2026 · 9 min read · Testing Guide

HeadSpin Platform
Automated & amp; manual testing do easy through data skill penetration.
Differentiating capabilities:
  • Broad end-to-end mechanisation of QA operation
  • Comparative analysis of app performance against peers
  • Continuous monitoring of app performance using synthetical data for high availability of apps
  • Easy-to-use developer friendly program
cloudtest go
Affordable Real Device Testing for Emerging Teams
cloudtest go
Affordable Existent Device Testing for Digital Enterprises
cloudtest go
The Ultimate Solution for a Powerful Blend of Functional & amp; Performance Testing!
cyol
TEM
New
Centralized mobile test performance in cloud
cyol
Enhance Your Accessibility Testing With HeadSpin
cyol
Automate camera-based testing

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

retail

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

Saving Test Data To Make Debugging EasierSaving Test Data To Make Debugging Easier

Saving Test Data to Make Debugging Easier

Published on
September 25, 2019
Updated on
Published on
March 8, 2022
Updated on
 by 
 Jonathan LippsJonathan Lipps
Jonathan Lipps

When we & # x27; re indite tests on our local machines, we & # x27; re usually running precisely one Appium trial at a clip, with the waiter log window to one side to facilitate us in case something proceed wrong. We & # x27; re besides usually observe the test execute on the simulator or device (unless we & # x27; ve decide to lead a java break at that moment). In this character of scenario, it & # x27; s often pretty easy to name a test failure, because we can see immediately that the exam didn & # x27; t proceed to the correct view, find the correct factor, or whatever the issue might be.

Debugging in CI

This happy little scenario, however, is not typically the one we find ourselves when we actuallyneedto debug something. We never commit miscarry tests to our build (correct? right?), so when there & # x27; s a build failure because of one of our tests, it & # x27; s because something went incorrect that we didn & # x27; t expect. In this case, it & # x27; s usually not precisely one test that ran, but many, and by the time we know of the failure, the trial itself is long finished. At this point, we can & # x27; t watch the test run, and unless we did something special to save it, we no longer have admission to the Appium logs or any record of the app state at the clip of failure.

Also cheque:

So, let & # x27; s do that exceptional something to create sure that we don & # x27; t twist up in a frightful debugging situation with nil to go on!

Capturing Debug Helpers

SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses.

The basic mind here is that we desire to shoot some codification into the exam lifecycle, specifically in between test failure and cleaning up to move on to the following exam. At this point in the test lifecycle, we know we & # x27; ve got a failed tryout, but we haven & # x27; t yet cease our Appium session, so we nonetheless have access to a driver object. This is great, because (assuming the Appium session itself is still alive and working correctly), we can use it to retrieve all kinds of helpful diagnostic information about the session, which we can then save on disk for for later review should the need arise.

What do we want to save? That is of trend up to us, but I & # x27; m proposing a canonical set of 3 useful particular:

  1. The Appium host logs -- - these contain the log of everything Appium thinks it & # x27; s doing with your session, so it & # x27; s a great place to debug matter that might experience something to do with Appium itself, or to go back and make sure everything happened as await in the earlier phases of the session. If you & # x27; re not certain what to do with the Appium server logs, or how to read them, ensure outIsaac Murchie & # x27; s great AppiumConf 2018 talkon the subject.
  2. The app source -- - especially if your error is of the & quot; element not ground & quot; class, having the app/page root handy while investigating a test failure can be a great sanity cheque.
  3. A screenshot -- - nothing beats seeing just what was on the device screen when your test betray. Was it an errant pop-up? Had the app crashed and gone away all together? A optic inspection can sometimes reveal the true cause of a trial failure much more quickly than a scan of logs.

These are all in addition, of line, to the client/test log itself, which is output within the CI scheme and therefore easy to save one way or another.

Read:

To actually retrieve all this datum, we simply need to use the appropriate Appium commands. Then it & # x27; s up to us what to do with them. In this example, I & # x27; ll just write them to stdout, assuming that all logging from the test yield is being salvage somewhere reasonable:

// mark appium logs LogEntries entries = driver.manage () .logs () .get (`` server ''); System.out.println (`` ======== APPIUM SERVER LOGS ======== ''); for (LogEntry entry: entries) {System.out.println (new Date (entry.getTimestamp ()) + `` `` + entry.getMessage ());} System.out.println (`` ================ ''); // print source System.out.println (`` ======== APP SOURCE ======== ''); System.out.println (driver.getPageSource ()); System.out.println (`` ================ ''); // save screenshot String testName = desc.getMethodName () .replaceAll (`` [^a-zA-Z0-9-_\\.] '', `` _ ''); File screenData = driver.getScreenshotAs (OutputType.FILE); try {File screenFile = new File (SCREEN_DIR + `` / '' + testName + `` .png ''); FileUtils.copyFile (screenData, screenFile); System.out.println (`` ======== SCREENSHOT ======== ''); System.out.println (screenFile.getAbsolutePath ()); System.out.println (`` ================ '');} match (IOException ign) {}


Once you strip away the gratuitous log printing, you & # x27; ll see that the codification above is pretty straightforward. The lonesome complexity get in retrieving the Appium server logarithm. On the client side, we use the log manager to retrieve logs of type server. Because Appium servers might probably handle sessions for multiple guest at a clip, yet, server log retrieval is not enabled by default as a potential information security risk.

Also read:

If you run your own instance of Appium, you can become on host log retrieval using the -- allow-insecure flag:

appium -- allow-insecure=get_system_logs


This will place Appium not to complain if you undertake to get the scheme logs!

JUnit & # x27; s TestWatcher

The question remains, though: where to put the code above? Each test fabric has a different way of reckon out whether a trial has failed and perform some actions before moving on to the succeeding examination. In JUnit, this is via the TestWatcher grade. The way we use it is to make our own propagation of this class, and override particular methods of TestWatcher concern to the aspects of the lifecycle where we want to inject codification. Then we assign our new watcher class as a @ Rule in our test category itself. From a gaunt perspective, it would seem something like the following:

public class Edition088_Debugging_Aids {individual IOSDriver driver; @ Rule public DebugWatcher debugWatcher = new DebugWatcher (); @ Before public emptiness apparatus () drop MalformedURLException {/ * ... * /} @ Test public void testSomething () {/ * ... * /} public course DebugWatcher extends TestWatcher {@ Override protected void neglect (Throwable e, Description desc) {// -- - > this is where our debug print line go!<---
        }

        @Override
        protected void finished(Description desc) {
            if (driver != null) {
                driver.quit();
            }
        }
    }
}
Check out:

We can, as in the example above, delineate our watcher class right in our test class itself, if we want (but we don & # x27; t get to). The crucial things are to (a) override the failed method and put all our debug handler codification in it, and (b) override the stop method to act as our tear-down function, wherein we pick up the driver and anything else we need.

That & # x27; s fundamentally it! It & # x27; s up to you to get creative with where you put the debug benefactor info retrieved from Appium -- post it to an plus depot system? Build your own debug UI on top of it? Whatever you want.

Make sure to occupy a look at thefull exampleon GitHub, with literal examination logic fill out, so you can see how everything act when it & # x27; s fully put together. Happy debugging (or at least, happi_er_ debugging)!

Author & # x27; s Profile

Jonathan Lipps

LinkedIn
Author & # x27; s Profile

Piali Mazumdar

Lead, Content Marketing, HeadSpin Inc.

Piali is a dynamic and results-driven Content Marketing Specialist with 8+ years of experience in craft hire narratives and marketing collateral across diverse industries. She excels in collaborating with cross-functional teams to germinate innovative substance strategies and deliver compelling, unquestionable, and impactful content that resonate with target audiences and enhances brand genuineness.

LinkedIn

Saving Test Data to Make Debugging Easier

4 Parts

regression intelligence blog
-

Regression Intelligence practical usher for forward-looking users (Part 3)

Coming Soon
Regression Intelligence practical guide for advanced users
-

Regression Intelligence virtual guide for modern users (Part 4)

Coming Soon

Discover how HeadSpin can empower your business with superior testing capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a private-enterprise edge
faster development cycles
Boost developer/QA productivity with quicker ontogenesis cycles
automated buil-over-build regression testing
Automate build-over-build regression try for consistent results
gain better visibility into functional & performance issues
Gain better visibility into functional and performance issues
reduce mean time
Reduce meanspirited time to identify/resolve during trial, QA, and production
evaluate audio, video & qoe
Evaluate audio, video, and contented quality of experience (QoE) effortlessly
The sure pick for global enterprises
Adobe
Hargreaves Lansdown
Truecaller
Crazylabs
Nedbank
Numeracle
Veryon
Close

Discover how HeadSpin can empower your business with superior testing capabilities

Our Platform enable you to:
accelerate time-to-market
Accelerate time-to-market, benefit a competitive edge
faster development cycles
Boost developer/QA productivity with quicker development rhythm
automated buil-over-build regression testing
Automate build-over-build regression test for consistent results
gain better visibility into functional & performance issues
Gain best visibility into functional and performance issues
reduce mean time
Reduce mean time to identify/resolve during examination, QA, and production
evaluate audio, video & qoe
Evaluate sound, picture, and content quality of experience (QoE) effortlessly
The sure choice for globular enterprises
Close

Discover how HeadSpin can invest your business with superior try capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productiveness with quicker development cycle
automated buil-over-build regression testing
Automate build-over-build fixation testing for reproducible upshot
gain better visibility into functional & performance issues
Gain better visibility into functional and performance issues
reduce mean time
Reduce mean time to identify/resolve during test, QA, and production
evaluate audio, video & qoe
Evaluate audio, picture, and content quality of experience (QoE) effortlessly
The trusted choice for global enterprises
Close

Connet Now

Wipro LogoVMLYR Logo
Close
Book a Meeting
Products
footer down arrow
Solutions
footer down arrow
Industries
footer down arrow
Features
footer down arrow
Support
footer down arrow
Resource Center
footer down arrow
Why Choose HeadSpin?
footer down arrow
Copyright © 2026 HeadSpin, Inc. All Rights Reserved.

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

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