1

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?

user7768692
  • 76
  • 1
  • 1
  • 6

3 Answers3

1

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

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

dmle
  • 3,498
  • 1
  • 14
  • 22
0

You should run:

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

Look at this post.

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

Note: driver must be of type AppiumDriver, if not you need to cast it

j.rmz87
  • 786
  • 1
  • 7
  • 18