This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
7 / 31
Feb 2018

relaunch the app by using driver.launchApp() method, you will able to go on homescreen :slight_smile:

Hope it will help.

Thanks for your answer.
I need to stay at the device home screen, launchApp method launch my app again.

I don’t need to launch the app, I need to be at the device home screen.
Need to do some actions in the device home screen.

Then you should use a loop according to the back button visibility, if back button is getting displayed then click on it till you reach home screen

I don’t have back button in my app.

I’m working in my app and need to click on home button of the IOS device.

This will also send the app in the background then will launch, but he needs to perform some operations in the app, don’t want to relaunch the app

@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.

Ah sorry. I was reading device home screen :smiley: not app home screen… It’s what we get for reading in diagonal.

Then its easier, he just needs to make the steps any normal user would do to go back to app home screen like you told.

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));

with XCuiTest driver you can interact with native iOS,yes. I use it to enable/disable WiFi, mobile data, location, permissions, etc.

is there any possible way that we can tap on the home button of the ios device ?
I think after tapping the home button, we can perform native ios operations and can again launch the app by providing bundle id.

on real ios devices thats not possible. For simulator I think there are scripts around to do that. But if you just want to go to homescreen you dont need to tap the home button, just use the above command.