To create object-based iOS tests, you need to instrument your tested iOS application. This topic explains how you can do this within TestComplete.
Do not submit instrumented applications to the App Store. Instrumented applications use private APIs and will be rejected. Create a separate build configuration for test builds.
Instrumentation of iOS applications is needed to expose their internal objects, methods and properties to TestComplete.
To instrument an application, TestComplete recompiles it with the TestComplete Agent library (TestComplete-agent-static.a) and the certificates that specify the developer, who uses the application.
TestComplete replaces your original .ipa file with its instrumented version. By default, TestComplete creates a backup copy of the file before instrumentation.
You will also need several certificate files that define the developer and the devices that can use this application.
You can perform all these steps directly in TestComplete. See below for details.
To instrument the application, TestComplete uses developer certificate files. You need to get them as describe in the Get Certificate Files topic.
TestComplete replaces the existing .ipa file with its instrumented version. So, the user account under which TestComplete is working needs read/write access to this file.
TestComplete can instrument your application when you are adding it to your project, or you can command TestComplete to instrument it any time later in the Tested Application collection. The latter approach is needed, if you already have your application on the list, but need to instrument it when a new build of the application is ready.
Start adding your iOS application to the Tested Applications list of your TestComplete project.
There are several ways to do this. For example, you can add applications when creating a new project with the Create New Project wizard or the Record Test wizard, or you can add applications to the Tested Apps list of an existing project. For more information on how you can include iOS applications into your project, see Adding iOS Applications to the List of Tested Applications.
Specify your iOS application file (.ipa).
To command TestComplete to deploy the specified application to your iOS device, select the Deploy to the device on start check box.
If you are adding the application via the Add Tested Application wizard, it will check whether the application is instrumented. If it is not instrumented, the wizard will ask whether you want to instrument the application. Choose to instrument.
The wizard will suggest backing up the original version of the application’s .ipa file. The backup copy is useful if you need the uninstrumented version of your application for some reason. So, if needed, select the Back up the original .ipa file check box and specify the backup file name.
Specify the path to the files holding certificate data for signing your application. If you add the application via the Record Test wizard, specify the certificate data on the Select Application Type and Settings > Mobile page. Otherwise,TestComplete will show a dialog asking for certificate data automatically.
You need to specify paths to the following files:
Apple Worldwide Developer Relations Certification Authority file
Developer certificate file
Provisioning profile file
For more information about these files and how to get them, see Get Certificate Files.
TestComplete will recompile your iOS application, and add it to the Tested Applications list of your project.
To instrument your application that is already added to the Tested Applications list:
Open the TestedApps list of your project. To do this, in the Project Explorer panel, double-click the TestedApps item.
In the list, select your iOS application and click Instrument. This will invoke the Instrument iOS Application wizard.
Follow the wizard instructions: specify the name of the application’s original .ipa file, choose whether you want to back up the original .ipa package, specify paths to the certificate files and click Finish on the last page of the wizard.