# Efficient Testing with Robolectric & Roborazzi Across Many UI States, Devices and Configurations

DevFeed: [Efficient Testing with Robolectric & Roborazzi Across Many UI States, Devices and Configurations](<https://devfeed.tech/articles/efficient-testing-with-robolectric-roborazzi-across-many-ui-states-devices-and-configurations-25690.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/efficient-testing-with-robolectric-roborazzi-across-many-ui-states-devices-and-configurations>)

Author: Sergio Sastre Florez

Published: 2023-11-09T21:45:00Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [screenshot-testing](<https://devfeed.tech/topics/screenshot-testing.md>), [ui-testing](<https://devfeed.tech/topics/ui-testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [Software Process](<https://devfeed.tech/topics/software-process.md>), [enum](<https://devfeed.tech/topics/enum.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [devices](<https://devfeed.tech/tags/devices.md>), [emulator](<https://devfeed.tech/tags/emulator.md>), [espresso](<https://devfeed.tech/tags/espresso.md>), [google](<https://devfeed.tech/tags/google.md>), [robolectric](<https://devfeed.tech/tags/robolectric.md>), [roborazzi](<https://devfeed.tech/tags/roborazzi.md>), [screenshot-testing](<https://devfeed.tech/tags/screenshot-testing.md>), [screenshots](<https://devfeed.tech/tags/screenshots.md>), [software](<https://devfeed.tech/tags/software.md>), [software-process](<https://devfeed.tech/tags/software-process.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [ui](<https://devfeed.tech/tags/ui.md>), [ui-testing](<https://devfeed.tech/tags/ui-testing.md>)

## AI overview

This tutorial explains how to use Robolectric and Roborazzi for screenshot testing across many UI states, devices, and configurations. It introduces parameterized tests, enum-based UI states, and device qualifiers for generating screenshots efficiently.

## Source excerpt

Robolectric is a popular UI testing tool from Google that enables running UI tests without a physical device or emulator. It supports most androidx.test APIs, like Espresso, ActivityScenario & FragmentScenario as well as ComposeTestRule. Robolectric ...