appium: "[ADB] Incorrect package and activity. Retrying." after using runAppInBackground()

The problem

For a specific test case i have to close and reopen the app in the same activity without resetting anything. The command driver.runAppInBackground(5) works well and the right screen appears after 5 seconds. But afterwarts the appium server says that the package and activity are incorrect

[ADB] Incorrect package and activity. Retrying. [ADB] Getting focused package and activity [ADB] Getting connected devices... [ADB] 1 device(s) connected.

Environment

  • Appium version: 1.0.0
  • Desktop OS/version used to run Appium: Windows 7
  • Node.js version (unless using Appium.app|exe):
  • Mobile platform/version under test: Android 6.0.1
  • Real device or emulator/simulator: Real Device
  • Appium CLI or Appium.app|exe: Appium Desktop

Details

I tryed to close the Application with the home button then open the application with the application icon on the screen or with driver.startActivity(). Both ways results on the homescreen of the application and not on that one i was before.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17

Most upvoted comments

@nagarjunay try adding capabilities.setCapability("autoGrantPermissions",true); And then wait for correct activity with capabilities.setCapability("appWaitActivity","Your activity")