In Android Studio 2.2 there is supposed to be a test recording function? Where do I find it and how do I use it?
-
1[Check this](http://www.androidpolice.com/2016/05/18/android-studio-2-2-preview-announced-with-a-new-layout-designer-test-recording-with-auto-generated-espresso-code-and-much-more/) – M D May 19 '16 at 09:23
-
But it only mention there is such a feature not where or how to use it? – Peter May 19 '16 at 09:27
-
3It is not available in Andorid Studio 2.2 Preview 1, check this https://code.google.com/p/android/issues/detail?id=210478 – Mohit Charadva May 20 '16 at 08:00
-
@PeterIsberg none right now, we need to wait for an update to android studio – Tim May 20 '16 at 12:34
-
It's confirmed from Google that this will be available only in future versions – Shehabic May 20 '16 at 20:42
-
I use http://droidtestlab.com/. I am guessing they are pretty much the same thing. – ericharlow May 27 '16 at 23:45
-
Android 2.2 preview 2 is out but still no espresso recoding. Hopefully they will include in next iteration. http://tools.android.com/recent/androidstudio22preview2available – tashi Jun 02 '16 at 23:52
-
It is now available with AS 2.2 preview 3 – Tim Jun 09 '16 at 08:25
-
Its out in preview 3 but its not working correctly. Only creating empty file. – Hisham Muneer Jun 13 '16 at 07:19
3 Answers
Update june 9th:
It is now available with android studio 2.2 preview 3!
Espresso Test Recorder
Demo of the Espresso Test Recorder shown at IO is now included in Preview 3
Download it here or patch directly from android studio preview 2.2
Update may 30:
Android Studio 2.2 preview 2 is out, but no 'Record Espresso Test' option yet.
Unfortunately the Espresso Test Recorder is still not in this build; we're addressing a few more issues and then hope to have it ready in the next build!
From the changelog.
Update:
It was not in the Advanced Espresso presentation as I expected, but in What's new in Android development tools (credit to flackery). They show where to find it:
It's also explained in the latest android-developers blog
Espresso Test Recorder: Sometimes writing UI tests can be tedious. With the Record Espresso UI tests feature, creating tests is now as easy as just using your app. Android Studio will capture all your UI interactions and convert them into a fully reusable Espresso Test that you can run locally or even on Firebase Test lab. To use the recorder, go to the Run menu and select Record Espresso Test.
However there is no way to get that option in the current release, updating all (platform)tools etc won't make a difference either.
For now we can only assume that this was unintentionally left out, and will be included in the first next release.
The only sensible thing I could find about this is
Creating tests is now as easy as using your app. Run your app in debug mode and enable recording, and this feature will capture UI events and convert them into Espresso Tests that you can run locally or even in the Firebase Test lab.
From venturebeat
Running in debug is simple, but enabling recording.. I'm not sure what they mean by that. There is a recording option, but that is for capturing the screen and saving it to a mp4 file.
There is currently nothing to be found on the net, and nothing in android studio itself either, that explains this feature in more detail than "it's there".
There will however be a talk at Google I/O today, Advanced Espresso, where they will talk about this new feature and I expect it to be clearer after that.
I will update my answer once I've seen the presentation.

- 41,901
- 18
- 127
- 145
It's now live with Android Studio 2.2 Preview 3. Please send all feedback and issues here: https://code.google.com/p/android/issues/entry?template=Espresso%20Test%20Recorder%20Bug

- 1,322
- 2
- 12
- 19
-
I tried Espresso tool in preview 3 but its not working correctly. Only creating empty test case file. – Hisham Muneer Jun 13 '16 at 07:22
-
Ahmed - We are definitely interested in it here at my shop (and we have like 10 Android developers and a company with 90,000 employees). A blog post or tutorial or documentation or deep dive or 'how it works' or best practice or something would be great. Particularly this: 1) Is it still best practice to test 'by activity' - activity test rule, intents, build the arguments, launch an activity and test in a java file. 2) how do you do that with test recorder? – nAndroid Jun 13 '16 at 16:36
-
Hisham, I saw your issue has been resolved by running Android Studio as an administrator. re: Best practices, we're working on finalizing our docs but here's one that's written by our amazing community contributors: http://peirr.com/writing-android-tests-with-espresso-test-recorder/ – Ahmed Mounir Jun 14 '16 at 23:01
As described in the Google I/O session 'What's new in Android development tools', we can access the 'Record Espresso Test' from the 'Run' menu.
Unfortunately this item is not available in Android Studio 2.2 Preview 1, and might be made available in a future release.

- 50,140
- 28
- 121
- 140

- 76
- 2