Instrumenting iOS Applications in TestComplete UI (Legacy)

Applies to TestComplete 15.68, last modified on October 16, 2024
The information below concerns legacy mobile tests that work with mobile devices connected to the local computer. For new mobile tests, we recommend using the newer cloud-compatible approach.

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.

About Instrumentation

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.

Instrumentation Requirements

  • To instrument the application, TestComplete uses developer certificate files. You need to get them as describe in the Get Certificate Files (Legacy) 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.

Instrumentation Procedure

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.

Instrumenting Application When Adding It to Tested Applications List

  1. 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 (Legacy).

  2. Specify your iOS application file (.ipa).

  3. To command TestComplete to deploy the specified application to your iOS device, select the Deploy to the device on start check box.

  4. 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.

  5. 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

    • PEM file

    • Provisioning profile file

    For more information about these files and how to get them, see Get Certificate Files (Legacy).

  6. TestComplete will recompile your iOS application, and add it to the Tested Applications list of your project.

Instrumenting Applications From TestedApps Editor

To instrument your application that is already added to the Tested Applications list:

  1. Open the TestedApps list of your project. To do this, in the Project Explorer panel, double-click the TestedApps item.

  2. In the list, select your iOS application and click Instrument. This will invoke the Instrument iOS Application wizard.

  3. 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.

See Also

Preparing iOS Applications (Legacy)
Preparing Test Computers and TestComplete for iOS Testing (Legacy)
Preparing iOS Devices (Legacy)
Testing iOS Applications - Overview (Legacy)

Highlight search results