Android app can not be brought to foreground on appium2
See original GitHub issueThe problem
Android app can not be brought to foreground on appium2 from background, which works on appium1.
Environment
- Appium version (or git revision) that exhibits the issue: v2.0.0-beta.43
- Last Appium version that did not exhibit the issue (if applicable): v1.23
- Desktop OS/version used to run Appium: MacOS Monterey 12.5.1 M1
- Node.js version (unless using Appium.app|exe): v18.8.0
- Npm or Yarn package manager:
- Mobile platform/version under test:
- Real device or emulator/simulator: Redmi Note8 (Android 9) and Pixel 2 (Android 11)
- Appium CLI or Appium.app|exe:
Details
We tried to launch and bring the Android Settings app to foreground, but it failed if the app was already in the background. Another wrong app will be started and brought to foreground.
Instead, if we manually killed the Settings app before execution. It will be brought to foreground, even if there’s another app already on the foreground.
By the way, right now it seems the shouldTerminateApp
does not work on Anroid, just leaving the app as is after the test run. Is there another capability to handle this?
Kindly please advise, thanks a lot in advance!
Link to Appium logs
https://gist.github.com/bswhb/6c4b5c05d1acaf3f718b577725d58588
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top Results From Across the Web
Bring app back to foreground from code doesn't work on ...
I have found the solution so I'll post it here if someone needs it. The code I use to put the application back...
Read more >Restrictions on starting activities from the background
Note: For the purposes of starting activities, an app running a foreground service is still considered to be "in the background".
Read more >Getting Started with Appium 2.0: Overview of the Core New ...
Appium is an open source test automation framework for use with native, hybrid and mobile web apps. It drives iOS, Android, and Windows...
Read more >appium/appium - Gitter
while i cannot see the element until i do not scroll the scrollable element that is the ... Does anyone know how to...
Read more >Android: bring application into foreground after backgrounding
To background, I'm sending the home button using mobile: keyevent 3, but to bring the app back I'm not sure about the best...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Do you use driver.activateApp(“com.android.settings”); and driver.terminateApp(“com.android.settings”);
This work for me with appium 2.0 ( but only used in emulators)
thanks for the info and issue closed