UIAutomation Driver for iOS
In general, UIAutomation Driver is DEPRECATED and should not be used unless absolutely necessary. The information in this doc may not keep up to date with reality. Further, the driver will be removed in a future version of Appium. Therefore, to begin iOS automation with Appium today, please use the XCUITest Driver instead.
Remember, the development of the UIAutomation driver is done at the appium-ios-driver repo.
What are requirements and support for UIAutomation Driver for iOS?
In addition, Appium’s general requirements include,
- Firstly, you would require Xcode 7 or lower.
- Secondly, iOS simulators or devices with version 9.3 or lower is also required
- Also, all versions of Appium ship with this driver are needed.
- Lastly, it requires correct functioning of the driver.
How to use UIAutomation Driver for iOS?
One of the ways to start a session using UIAutomation driver is to set the platformName capability in your new session request to the value of iOS. Also, you must also include appropriate platformVersion, deviceName, and app capabilities, at a minimum.
The UIAutomation driver supports a number of standard Appium capabilities, but has an additional set of capabilities that work for this driver only. Therefore, to automate Safari instead of your own application, leave the app capability empty and instead set the browserName capability to Safari.
In order, to see the various commands Appium supports, and specifically for information on how the commands map to behaviors for the UIAutomation driver.
Due to limitations of Xcode and the iOS simulator, only one simulator may be open, and automated, at any given time. Therefore, for multiple simulator support, you will need to upgrade to the XCUITest driver
Real Device Setup
Running tests on real devices is considerably more complicated due to code signing and additional workarounds to Apple limitations. Therefore, the basic process for a successful automation strategy using this driver are as follows –
- Firstly, Build your app with a Debug configuration, for the specific type of real device you will run the test on, ensuring that the app is also signed for running on your specific device.
- Secondly, Install the built app to your test device yourself, ensuring it exists on the device and there are no signing issues.
- Thirdly, Use the bundle ID of your application as the value of the app capability.
- Next, use the UDID of your device as the udid capability.
- Lastly, ensure that UI Automation is enabled in the Developer settings.
Real Device Hybrid / Web Testing
Tests that run in the Safari browser, we have another hurdle to jump. On real devices, apps that are not signed by the developer cannot be instrumented with UIAutomation. Safari is one such app. Thus we have a helper app called SafariLauncher, which can be signed by the developer. Its sole purpose upon launching is to turn around and launch Safari, which can then be automated via the Remote Debugger in conjunction with IWDP.