Menu
AWS Device Farm
Developer Guide (API Version 2015-06-23)

Working with UI Automation for iOS and AWS Device Farm

Device Farm provides support for UI Automation for iOS. The following information describes how to use this test framework with Device Farm test types.

What is UI Automation?

You can use the Automation instrument to automate user interface tests in your iOS app through test scripts that you write. These scripts run outside of your app and simulate user interaction by calling the UI Automation API, a JavaScript programming interface that specifies actions to be performed in your app as it runs in the simulator or on a connected device. For more information, see About Instruments in the Instruments User Guide section of the iOS Developer Library.

Upload Your iOS UI Automation Tests

To run your iOS UI Automation tests on a set of iOS devices in Device Farm, you upload your tests with the Device Farm console as follows:

  1. Sign in to the Device Farm console at https://console.aws.amazon.com/devicefarm.

  2. In the list of projects, choose the option next to the project that you want to upload your tests to.

    Tip

    If the list of projects is not displayed, then on the secondary navigation bar, for Projects, choose the name of the project that you want to upload your tests to.

    To create a new project, follow the instructions in Create a Project.

  3. If the Create a new run button is displayed, then choose it.

  4. On the Choose your application page, choose Upload.

  5. Browse to and choose your iOS app file. The file must be an .ipa file.

    Note

    Make sure that your .ipa file is built for an iOS device and not for a simulator.

  6. Choose Next step.

  7. On the Configure a test page, choose UI Automation, and then choose Upload.

  8. Browse to and choose the .js file for a single test.

  9. Choose Next step, and then complete the remaining on-screen instructions to select the devices to run your tests on and to then start the run.

Taking Screenshots in iOS UI Automation Tests

You can take screenshots as part of your iOS UI Automation tests.

To take a screenshot, call the captureScreenWithName function, for example: target.captureScreenWithName(lang + "_home");, where lang is the current language name.

Additional Considerations for iOS UI Automation Tests

Device Farm adds logging hooks so that it can monitor the execution flow of iOS UI Automation tests, but Device Farm does not modify iOS UI Automation tests themselves.