Writing test case in Java for iOS App

Hello, I am new in appium.
I am trying to write test cases in java for iOS app. After executing 1 test case I want to switch to homepage/1st page of iOS app. Can you please suggest me how to do this.
Thanks.

Hi @manjiris ,

Apparently , There is no direct implementation in IOS that can switch to other Page. I guess this will done by two ways,

  1. Click on back button (if there in your app) , until you reach .
  2. Click on Home button in your app if it is available.

Note : we can switch to home page of Android App through startActivity() by giving appActivity .

Regards,
Vijay Bhaskar.

Ok. thanks I will try for this solution. But one small question. I can navigate to back using following line- driver.navigate().back();
But how to determine that how many times I will have to write this statement to reach upto home screen. ie. How can I get total number of screen?

Hi,

Put a for loop and inside if condition that ,"if home page element displayed then break "…
Have a try with that.

Will this statement “driver.navigate().back();” working on IOS? I guess this will works for Android only.Please let me know if it works for IOS too…i haven’t checked it yet.

Regards,
Bhaskar.