AWS Device Farm integration

The AWS Device Farm (ADF) integration is ideal for unattended testing, where you are unsure of which devices will be available at the time of the test.

Run tests with ADF devices

This section describes how to set up your Amazon environment to work with an on-premises Mobile Center server, where the server is installed on a machine on your premises, and only the connector accesses the AWS device farm.

For details on integrating with an off-premises Mobile Center server, see Set up a Mobile Center server on AWS.

Note: AWS Device Farm integration is not supported for iOS due to ADF iOS connection restrictions. For details, see the Readme.

To integrate your on-premises Mobile Center server with ADF:

  1. Verify that you have an active Amazon Web Services (AWS) account. Otherwise, create a new account. Make sure that your IAM role includes access to the ADF service and S3 access. For details, see IAM Roles for Amazon EC2.
  2. Make sure you have a Mobile Center Connector installed on the machine from which you want to access the AWS Device Farm. The Connector machine's clock must be synchronized with the Internet. For details, see Install the connector on a Linux machine, Install the connector on a Windows machine or Install the connector on a Mac machine.
  3. Allow the following outbound traffic from the connector:

    Ports: 443 (HTTPS) and 23451 (HTTP).

    IPs: The IP ranges as published by Amazon. For details, see Obtain IP Addresses.

  4. Authorize inbound traffic (Whitelist) for the AWS Device Farm host. You do this by submitting a request to MC_ADF_cloudburst@microfocus.com, to allow your IP to be included in Amazon's authorized list. Your email should include the following:

    • Your AWS account ID
    • The range of IP addresses from which to expect requests to originate. Ask your IT group to provide this information, or go to http://aruljohn.com/details.php. For example, if your IP address is 33.44.55.66, the IP range is 33.44.55.xx.
  5. After the Whitelist request is approved for your Mobile Center server, open the Administration > Administration Settings window in Mobile Center and expand the Amazon Device Farm Integration section. Choose Yes for the Enable ADF connector and Is AWS Device Farm connector whitelisted settings. Provide the AWS access keys, and select a connector.

    • If your machine uses a corporate proxy to access the Amazon API, enter the proxy machine details. You must restart the server after saving these settings, in order for the proxy settings to take effect.

      Note: If the app that you are testing does not support NTLM authentication, the corporate proxy may block the app’s access to the Internet. To allow Internet access, install a third party tool such as Cntlm, that connects non-NTLM apps with the corporate network, by adding NTLM authentication on the fly.

    • Accept the automatically generated bucket name, or specify another bucket name. Specifying a bucket name allows you to set the AWS policy for a specific bucket. This should be the Amazon S3 bucket to which you have applied to proper security and permission policies.
      Alternatively, select Auto-create S3 bucket to instruct Mobile Center to create a new S3 bucket, instead of using an existing one. Refer to the Amazon documentation for more information about S3 buckets.

    Click Verify and Save. When you click Verify and Save it will check that Mobile Center can access the bucket.

  6. Using your testing tool, open the Mobile Center Wizard which opens to the DEVICES page.

    1. In the Choose Capabilities pane, select Amazon Lab in the Target Lab section.
    2. Choose a device based on your filter or rule.
    3. Click APPS and select one or more apps.
    4. In TEST OPTIONS, select Install to install the apps on the device before running the test.
    5. Click Save and Close.
  7. Start the test run from the testing tool. You may notice a delay the first time you run a test, since the device farm requires several minutes to allocate the device. To determine the state of your test, refer to the AWS Device Farm dashboard. A pending icon indicates a test in the Amazon queue, while the running icon indicates a test that is running.

    Tip: If your test fails due to timeouts, add a Wait step to compensate for extra network activity.

Back to top

Obtain IP Addresses

To allow your connector to communicate with Amazon, you need to allow outbound traffic from the connector to the relevant AWS IPs. You can view the list of IPs below, or retrieve it on your own through AWS tools.

To retrieve the relevant AWS IP ranges list on your own, using the AWS tools:

  1. Install AWS Tools for Windows Power Shell.
  2. Run the following command from the power shell to save the IPs to a file named IP_ranges.txt:

    Get-AWSPublicIpAddressRange -Region "us-west-2" | where {$_.service -eq 'AMAZON' -or $_.service -eq 'EC2' -or $_.service -eq 'S3'} > IP_ranges.txt

For further information, see AWS IP Address Ranges.

Back to top

Obtain logs

After a test run, you can view the logs. Logs are only available after the device is deallocated, For example, in UFT attended mode, when you close the solution or when it reaches the idle timeout.

Mobile Center automatically deallocates a device upon test completion or after an idle time of 5 minutes when no tests are being run on the device.

To view logs:

ADF logs

Open the AWS console and select Services > Device Farm. Select the relevant Project, Run, and Device. In the Mobile Center scenario section, download the following: Logcat (Android), idevicesyslog (iOS), Calabash Standard Output, and Video.

Mobile Center logs (admins)

To obtain the logs, use the Collect Logs feature. For details, see Viewing system information and logs.

Back to top

Continuous integration

You can use the ADF with a CI (Continuous integration) tool such as Jenkins using the Mobile Center integration. For details, see the Automation Add-in Jenkins page.

See also: