iOS_Shooterr
iOS_Shooterr

Reputation: 66

UIAutomation Testing module in Instruments Xcode

What type of tests can be done using UIAutomation module in Instruments in Xcode?

The tests are written in javascripts. One of the test can be done is to check if textfield has particular string or empty.

This type of tests can be done through objective-c also, then why should one use UIAutomation.

Upvotes: 0

Views: 366

Answers (1)

Aaron
Aaron

Reputation: 3406

You are correct that the types of tests can be done through objective-c (via "UI Testing"), but that is a new feature of Xcode 7. Before Xcode 7, writing tests to automate the UI via instruments was the only way to interact with a device in an Apple-supported manner, and provided commandline support.

Now that Xcode 7 is out with its UI Testing, instruments's UIAutomation is deprecated. If you are writing new tests, you should avoid UIAutomation if you can help it. As of Xcode 8, UIAutomation is actually removed, so definitely don't use it.

Deprecations

•The existing UIAutomation support in Instruments is deprecated. Use UI testing in Xcode 7. (22345571)

https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/Chapters/xc7_release_notes.html#//apple_ref/doc/uid/TP40001051-CH5-DontLinkElementID_178

--

All that said, there are still some advantages to instruments and UIAutomation over the new UI Testing (at least as of this moment). Right now you need a lot less to run an instruments test against an attached device. You just need Xcode, a trusted device set up for development, your application on the device, and the script you want to run against the application. Getting the application onto the device is a bit difficult because Apple didn't provide good ways to do that in an automated fashion, but there are a lot of third-party frameworks built up to solve this problem.

On the other hand, UI Testing needs Xcode, a trusted device set up for development, a project set up with your application and your UI Testing target, and then you need to use xcodebuild to run it. Depending on what kind of automation you want to run, having to make sure your machine is set up to build your project might be troublesome or expensive.

Upvotes: 2

Related Questions