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

Stop a Run in AWS Device Farm

You may want to stop a run after you have started it. For example, you may notice an issue while your tests are running and wish to restart the run with an updated test script. This topic describes how to stop a run and what the implications are for billing.

To stop a run, you can use the Device Farm console, the AWS CLI, or the Device Farm API.

For information about runs, see Runs.

Prerequisites

  • To stop a test run, you must have a test run created and actively running. For more information, see Create a Test Run.

Stop a Run with the Device Farm Console

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

  2. From the Device Farm console home page, choose the project where you have an active test run.

  3. On the Run results page, choose the test run.

    Your screen should look like the following image (with the pending or in-progress icon to the left of the device name).

    
                    Device Farm - Stop a test run
  4. Choose Stop run.

    The button changes to Stopping, and after a short time the icon next to the device name also changes to the Stopping icon (a pulsing orange circle with a square inside it). When completely finished, the icon changes to an orange square.

    Important

    If a test has already finished, Device Farm cannot stop it. If a test is in progress, Device Farm will stop the test and you will see the total minutes for which you will be billed in the Devices section. In addition, you will still be billed for the total minutes that Device Farm takes to run the Setup Suite and the Teardown Suite. For more information, see Device Farm Pricing.

    The following image shows an example Devices section after a test run was successfully stopped.

    
                    Device Farm - Details page of a stopped run

Stop a Run with the AWS CLI

You can run the following command to stop the specified test run, where myARN is the Amazon Resource Name (ARN) of the test run.

Copy
$ aws devicefarm stop-run --arn myARN

You will see output similar to the following:

Copy
{ "run": { "status": "STOPPING", "name": "Name of your run", "created": 1458329687.951, "totalJobs": 7, "completedJobs": 5, "deviceMinutes": { "unmetered": 0.0, "total": 0.0, "metered": 0.0 }, "platform": "ANDROID_APP", "result": "PENDING", "billingMethod": "METERED", "type": "BUILTIN_EXPLORER", "arn": "myARN", "counters": { "skipped": 0, "warned": 0, "failed": 0, "stopped": 0, "passed": 0, "errored": 0, "total": 0 } } }

To get the ARN of your run, use the list-runs command. The output will be similar to the following:

Copy
{ "runs": [ { "status": "RUNNING", "name": "Name of your run", "created": 1458329687.951, "totalJobs": 7, "completedJobs": 5, "deviceMinutes": { "unmetered": 0.0, "total": 0.0, "metered": 0.0 }, "platform": "ANDROID_APP", "result": "PENDING", "billingMethod": "METERED", "type": "BUILTIN_EXPLORER", "arn": "Your ARN will be here", "counters": { "skipped": 0, "warned": 0, "failed": 0, "stopped": 0, "passed": 0, "errored": 0, "total": 0 } } ] }

Note

For information about using Device Farm with the AWS CLI, see AWS CLI Reference.

Stop a Run with the Device Farm API

  • Call the StopRun operation to the test run.

For information about using the Device Farm API, see API Reference.