IOSDriver.startActivity() is not working in IOS

Hello,
After I set the capabilities and ran a few tests in IOS real device,
i want to open the mail app to check a certain mail has arrived.
In Android I used the driver.startActivity() method but with IOS i can’t use it, why?
i’m using iPhone 6s, version 10.0.2, Xcode 8.1.

Thank you,
Tal.

When using Appium for an IOS device, you need to provide different capabilities than when you are connecting to an Android Device. To your specific question, I don’t believe iOS supports the Start Activity capability.

For Android I use the following capabilities:

  • platformName
  • udid
  • deviceName
  • app
  • appPackage
  • appActivity

For iOS I use:

  • platformName
  • platformVersion
  • deviceName
  • udid
  • app

If you need more details, it would be helpful to post your full list Appium sever capabilities for people to look at.

Here is a list of valid server flags/capabilities:
http://appium.io/slate/en/v1.2.0/?ruby#server-flags

Hope that helps some.

Is there any other way to open a URL in IOS? maybe check the e-mail by web…?
I tried using the driver.get(URL string) and it didn’t work…

If you are using Appium 1.5.X and down, you must use the SafariLauncher project. If you are using Appium 1.6+ the WebDriver Agent should be able to launch Safari. You need to specify that you want to launch Safari in your capabilities as browserName=“Safari”, however I’m not sure if you can switch from a Native/Hybrid app to Safari easily.

When i set this capability, it doesn’t install my app at all :frowning:

Correct, that targets Safari.

Is is possible to install the app and also set this capability?
i’m trying to open a link that will lead to my app (deep link test), so i need my app installed…

If you app has is a hybrid app with a link that opens in a webview, you can switch contexts and interact with it. Inside of that webview you can force it navigate to other URLs, potentially including a web mail client…

I haven’t really dug into the new capabilities of Appium 1.6.X and the XCUITest framework, so there may be some other potential options.

ok, thanks.
is there any way to open any other app that is not native? such as Gmail ?