问题描述
我正在尝试对android应用程序进行espresso UI测试,以检查会话在后台运行并再次运行后是否仍然存在
我尝试使用该代码
val device = UiDevice.getInstance(getInstrumentation())
device.pressHome()
device.pressRecentApps()
device.findobject(UiSelector().text(getInstrumentation().targetContext.getString(getInstrumentation().targetContext.applicationInfo.labelRes)))
.click()
并且它适用于SDK = 29时,当按下最新的应用程序后尝试单击该应用程序时,它会冻结
这是错误消息的日志
androidx.test.uiautomator.UiObjectNotFoundException: UiSelector[TEXT=My Application]
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)