To kill/close app I tried driver.close(), driver.closeApp(), driver.quit()
but the app keeps running on the background.
Should one of these commands really close the application? If so, the how? If not - could someone offer an alternative solution?
None of the method that you are calling removes the app from background while using appium. This is what they refer to :
((AppiumDriver)driver).closeApp(); // Close the app which was provided in the capabilities at session creation
((AppiumDriver)driver).close(); // from *RemoteWebDriver.java*, used to close the current browser page
((AppiumDriver)driver).quit(); // quits the session created between the client and the server
so what you could possibly try and do is :
((AppiumDriver)driver).resetApp(); // Reset the currently running app for this session
OR try a combination of these two :
((AppiumDriver)driver).removeApp(<package name>); // Remove the specified app from the device (uninstall)
((AppiumDriver)driver).installApp(<path to apk>); // Install an app on the mobile device
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With