1
votes

Im using Appium to test my iOS app on real device. During the test I need to go to the home screen (I must do so) but can't find a way to do it.

I found here that there is an option to use the accessibility for Home button- Appium iOS can't inspect notification layer

but how can I click on this? Appium doesn't recognized this button.

Any suggestions?

2

2 Answers

0
votes

Using Appium Java client you can switch to Home screen on iOS the same way as on Android:

driver.runAppInBackground(Duration.ofSeconds(-1));

0
votes

You should run:

driver.executeScript("mobile: pressButton", ImmutableMap.of("name", "home"));

Look at this post.