Android api等级为25,显示不推荐使用InstrumentationTestCase,可以选择什么?

时间:2017-07-05 07:19:13

标签: android ui-automation

试图通过UI Automator自动化Android应用,但是当我扩展InstrumentationTestCase时,我发现它已被我的api等级25弃用。那么我如何能够解决这个问题,请提供一个例子。

1 个答案:

答案 0 :(得分:0)

根据文档InstrumentationTestCase在Api 24中弃用

  

此类在API级别24 中已被弃用。使用InstrumentationRegistry   代替。应使用Android Testing Support Library编写新测试。

您可以按照this教程获取一个工作示例。