Android – Record Espresso Test

Android Studio has a very useful tool, the Record Espresso Test. It records the action on your application and creates an instrumented class file. Go to Run > Record Espresso Test. Choose the deployment device and click OK. Your app will start and together it will open a window that shows your actions.

I typed Kronos. I also clicked Add assertion. Then I have to choose the view on the screen for the assertion. Select what type of matcher and the text.

Record Espresso Test, <span>Android – Record Espresso Test</span>, KandZ

I clicked Save Assertion and then OK. I have to specify the name of the test class file so Android Studio could create the file. Here is the file that has been created

Record Espresso Test, <span>Android – Record Espresso Test</span>, KandZ
Record Espresso Test, <span>Android – Record Espresso Test</span>, KandZ
Record Espresso Test, <span>Android – Record Espresso Test</span>, KandZ

The conclusion is that this tools is good to start an instrumented test, and skip a lot of coding 😛 Please notice that it is very slow while running on Linux. It was faster in a Windows machine.

THE END!!!

96150cookie-checkAndroid – Record Espresso TestAndroid – Record Espresso Test

Related posts