I've been using AndroidViewClient for a couple of months now and I like it so far, it's simple and a pretty powerful tool. I'm trying to develop an automated testing platform for more extensive and thorough automated testing of our product and I'm going to have to decide whether we stick with AndroidViewClient or move to Espresso or other tools such as selenium. I know Androidviewclient is basically for black-box testing and does not need access to the source code. Can someone list some capabilities/advantages of Espresso that AndroidViewClient does not offer? I'd like to see a comparison between the two tools in terms of capabilities.
1 Answers
It's a really good question but I'm afraid there's not a direct and simple answer, it's depend on the context.
Furthermore, the closest comparison would be AndroidViewClient/culebra vs. UI Automator, as they all have different objectives:
- Espresso: UI testing framework; suitable for functional UI testing within an app. Espresso is well-suited for writing white box-style automated tests, where the test code utilizes implementation code details from the app under test.
- UI Automator: UI testing framework; suitable for cross-app functional UI testing across system and installed apps. he UI Automator testing framework is well-suited for writing black box-style automated tests, where the test code does not rely on internal implementation details of the target app.
Regarding UI Automator vs AndroidViewClient/culebra, both provide almost the same functionality as one of AndroidViewClient/culebra possible backend is precisely UI Automator. The main difference is of course the former uses Java and the latter python.
Espresso biggest advantage is UI thread synchronization, which helps to avoid tests that can fail randomly because of timing issues. This testing issue is referred to as test flakiness. Prior to Espresso, the workaround was to insert a sufficiently long sleep or timeout period into a test or to add code to keep retrying the failing operation.
culebra generates tests (and scripts) automatically for UI Automator. The code is generated by recording your own interactions on a device so you don't have to actually write any test code. The next generation, CulebraTester has a new UI and the ability of generate python, Java and javascript tests.
Espresso Test Recorder in latest Android Studio preview does almost the same for Espresso.

- 65,697
- 9
- 111
- 134