-2

If I click on Contact Us link in my application, mail client will open. I don’t have back button to come back to my app. I can navigate back in android using

((AndroidDriver) driver).pressKeyCode(AndroidKeyCode.BACK);

Is there any similar way in iOS to navigate back?

Deepak
  • 41
  • 1
  • 5

4 Answers4

0

I don't think there is any key like in Android to go back in iOS. May be you can click x, y location of back button on the screen using driver.tap function.

Thejus Krishna
  • 1,755
  • 1
  • 19
  • 28
0

User selenium navigate back it works in Appium also.

driver.navigate().back()
Om Prakash
  • 793
  • 7
  • 14
  • @T.Che : is the app support back function ? – Om Prakash Jul 06 '21 at 09:17
  • it's only going to work if the app has a back button added from the development side. but if the user redirects to webview then I think only the relaunch app gonna help. – T.Che Jul 06 '21 at 09:34
0

Xpath: private PointOption iosBackButtonLocationInUpperLeftCorner = PointOption.point(36, 36) //Specifically for iPhone 12 Pro Max

Use this in your method: new TouchAction(driver).press(iosBackButtonLocationInUpperLeftCorner).release().perform()

Using appiums automator tool you can look up the coordinates of where the area is that you need to click back on. Sometimes for ios its in the status bar. Use the code above and plug in the coordinates you wish to tap. Should work.

0
driver.navigate().back(); 

This worked for me in iPhone 12 (14.5)

Ole Pannier
  • 3,208
  • 9
  • 22
  • 33