Was trying to automate an android app by UI Automator
, but when I extends InstrumentationTestCase
, i found it is deprecated with my api level 25 . So how I can solve this problem any alternative class, please provide a example .
Asked
Active
Viewed 2,356 times
1

Jeffrey Rajan
- 4,391
- 4
- 27
- 37

Shawon Barua
- 61
- 10
-
1InstrumentationTestCase class was deprecated in API level 24. --https://developer.android.com/reference/android/test/InstrumentationTestCase.html – AskNilesh Jul 05 '17 at 07:22
-
follow this link https://stackoverflow.com/questions/38308041/applicationtestcase-deprecated-in-api-level-24 – AskNilesh Jul 05 '17 at 07:24
1 Answers
1
As per the doc InstrumentationTestCase
was deprecated in Api 24
This class was deprecated in API level 24. Use InstrumentationRegistry instead. New tests should be written using the Android Testing Support Library.
You can follow this tutorial for a working example.

Jeffrey Rajan
- 4,391
- 4
- 27
- 37
-
Thank you .But how to use InstrumentationRegistry ? I tried as InstrumentationTestCase , it does not work ,an example would be better ,as i am new to this. – Shawon Barua Jul 05 '17 at 07:26
-
I have updated my answer with the tutorial link you can go through it. – Jeffrey Rajan Jul 05 '17 at 07:29