Sign in Go Pro

Espresso Test Recorder

Combating Shared State

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next

Previous

About

In this lesson, we look at the problem of shared state between runs of Android tests. We explain why the "Launch and tear down settings" section of the `Espresso Test Recorder` settings exist, and discuss strategies to combat them. We also talk about what a hermetic test execution environment is, and how it combats the problem of shared state. "Hermetic" is defined as "A seal or closure that is airtight". It is important to completely isolate each test execution so that the shared state of the Android app doesn't leak into subsequent test runs. **Related links:** * [Espresso Test Recorder Documentation](https://developer.android.com/studio/test/espresso-test-recorder.html) * [Android Developers Blog - Android Testing Support Library 1.0 is here!](https://android-developers.googleblog.com/2017/07/android-testing-support-library-10-is.html) **Related Caster.IO Lessons:** * [Executing Tests with Android Test Orchestrator](https://caster.io/lessons/executing-tests-with-android-test-orchestrator/ ) * Other lessons in the [Espresso Test Recorder](/courses/espresso-test-recorder/) course

Lessons in Espresso Test Recorder