No it doesn’t @Shubham_Agarwal. The -1 on the duration means it will stay in the background.
@Telmo_Cardoso - Yeah I am agree with you, but I don’t think there is way to go homescreen if we don’t have back button in the application. we have to either use launchApp() or runAppInBackground(duration) and both of them sends the app in the background.
one more thing runAppInBackground(duration) method, persists the last state of the application.
Yeah … that’s the thing
It was nice discussion with you @Telmo_Cardoso , Thanks
Hi guys. thanks for your answers.
Actually I mean device home screen.
The scenario is that - I’m doing some actions in my app then I need to background my app and do some actions in device home screen after that I need to go back to my app, so, I can do all but going to the device home screen.
I will check your suggestion to do:
driver.runAppInBackground(Duration.ofSeconds(-1));
@Telmo_Cardoso’s solution is good for your scenario, but I think this will not permit you to perform actions on device homescreen.
@Telmo_Cardoso - do you know about this ? I haven’t perform this thing so I also excited to know.
The -1 in the duration makes that it doesn’t goes back to app automatically
Test it:
driver.runAppInBackground(Duration.ofSeconds(-1));
This change is based on appium/appium-xcuitest-driver#381, which makes possible to minimize the application under test and then return to iOS springboard (emulates clicking Home button).
Thank you for your response, with app package, it launches the app from the first point which required Login, I want to just back the same page as I left the app and see the prompt message.
Do you have any suggestion?
but with this
driver.activateApp ( “app package”, null );
driver.navigate ().back ();
it works now but I think there is another better way for it.