Manage tests

Test how configuration changes affect your web content on the Akamai edge network before activating. Use our testing tool to prevent issues caused by misconfiguration and insufficient testing, increasing your confidence in the safety and correctness of your configuration changes.

Use it with Property Manager and Security configurations. It serves as an addition to your existing tests and workflows, not as their replacement.

Configure a test suite

Test suites act as containers for test cases. You can add a name and description to a test suite to provide more details about the test suite and the included test cases. You can also decide whether the test suite needs to be locked or stateful.

Test suites can be tested as test objects for property versions or on their own.

Create

When creating a new test suite, define its required settings in a variable as a hashtable, PSCustomObject, or JSON string. Then pass the variable in the -Body parameter of the New-TestSuite command.

Argument Required Description
isLocked When set to true, this locks the test suite so that only designated owners or editors can modify it.
isStateful When set to true, this runs the test suite statefully, retaining cookies and session data for subsequent test cases within the test suite.
testSuiteName A human-readable name for your test suite.
testSuiteDescription A human-readable description that identifies your test suite.
configs Specifies a property associated with a test suite. Includes:
  • propertyManager. Required. Details of a property associated with a test suite. Includes:
    • propertyVersion. Required. Your property's version number.
    • propertyId. Your property's ID.
    • propertyName. Your property's name.
Note: When specifying a property, you can provide either a property name with its version or a property ID with its version.
$MyNewTestSuite = @{
   configs = @{
      propertyManager = @{
        propertyName = "my-property"
        propertyVersion = 1
      }
   }
   isLocked = $true
   isStateful = $true
   testSuiteDescription = "This test suite performs a basic check of www.example.com"
   testSuiteName = "My-Test-Suite"
}

New-TestSuite -Body $MyNewTestSuite
$MyNewTestSuite = '{
  "configs": {
    "propertyManager": {
      "propertyId": 12345,
      "propertyVersion": 1
    }
  },
  "isLocked": true,
  "isStateful": true,
  "testSuiteDescription": "This test suite performs a basic check of www.example.com",
  "testSuiteName": "My-Test-Suite"
}'

New-TestSuite -Body $MyNewTestSuite
createdBy               : jsmith
createdDate             : 4/26/2025 11:18:07 AM
modifiedBy              : jsmith
modifiedDate            : 4/26/2025 11:18:07 AM
testSuiteId             : 12345
testSuiteName           : My-Test-Suite-1
testSuiteDescription    : This test suite performs a basic check of www.example.com
isLocked                : True
isStateful              : True
executableTestCaseCount : 0
configs                 : @{propertyManager=}

If you want to generate a template test case with a default set of test cases and variables for a specific property version and a URL, add the -AutoGenerate switch parameter to the New-TestSuite command. In this case, you need to pass a different request body as the -AutoGenerate switch parameter uses a different endpoint.

If you associate a test suite with a property version, Test Center looks for up to 5 previous versions of this property in Test Center, and if found, propagates test cases from test suites created for these properties to your new test suite. You need to review these test cases and verify if they still apply.

Argument Required Description
configs Specifies a property associated with a test suite. Includes:
  • propertyManager. Required. Details of a property associated with a test suite. Includes:
    • propertyVersion. Required. Your property's version number.
    • propertyId. Your property's ID.
    • propertyName. Your property's name.
Note: When specifying a property, you can provide either a property name with its version or a property ID with its version.
testRequestUrls Fully qualified URLs you want to use to generate the test suite. The URLs need to include a protocol, a hostname, a path, and any optional query parameters.

Once you get the result, you can either:

  • Save it locally and edit it according to your needs.

    $MyAutoTestSuite = @{
      configs = @{
          propertyManager = @{
            propertyName = "my-property"
            propertyVersion = 1
          }
      }
      testRequestUrls = @("https://www.example.com")
    }
    
    New-TestSuite -Body $MyAutoTestSuite -AutoGenerate | ConvertTo-Json -Depth 100 | Out-File -FilePath ./myAutoTestSuite.json
    
     $MyAutoTestSuite = '{
      "configs": {
        "propertyManager": {
          "propertyId": 12345,
          "propertyVersion": 1
        }
      },
      "testRequestUrls": ["https://www.example.com"]
    }'
    
    New-TestSuite -Body $MyAutoTestSuite -AutoGenerate | ConvertTo-Json -Depth 100 | Out-File -FilePath ./myAutoTestSuite.json
    
    {
      "testSuiteName": "Default test suite for my-property v1",
      "isLocked": true,
      "isStateful": false,
      "configs": {
        "propertyManager": {
          "propertyId": 12345,
          "propertyName": "my-property",
          "propertyVersion": 1
        }
      },
      "testCases": [
        {
          "testRequest": {
            "testRequestUrl": "{{protocol}}://{{host}}{{path}}",
            "requestMethod": "GET"
          },
          "clientProfile": {
            "client": "CHROME",
            "ipVersion": "IPV4",
            "geoLocation": "US"
          },
          "condition": {
            "conditionExpression": "Content provider code is \"98765\""
          }
        },
        {
          "testRequest": {
            "testRequestUrl": "{{protocol}}://{{host}}{{path}}",
            "requestMethod": "GET"
          },
          "clientProfile": {
            "client": "CHROME",
            "ipVersion": "IPV4",
            "geoLocation": "US"
          },
          "condition": {
            "conditionExpression": "Origin server - Cache key hostname is \"\""
          }
        },
        {
          "testRequest": {
            "testRequestUrl": "{{protocol}}://{{host}}{{path}}",
            "requestMethod": "GET"
          },
          "clientProfile": {
            "client": "CHROME",
            "ipVersion": "IPV4",
            "geoLocation": "US"
          },
          "condition": {
            "conditionExpression": "Caching option is cache with max-age of \"50000\" seconds"
          }
        }
      ],
      "variables": [
        {
          "variableName": "host",
          "variableValue": "www.example.com"
        },
        {
          "variableName": "protocol",
          "variableValue": "https"
        },
        {
          "variableName": "path",
          "variableValue": "/"
        }
      ]
    }
    

    Then convert it back to a PowerShell object and pipe it back to the New-TestSuite command to create an actual test case.

    $MyActualTestSuite = Get-Content ./myAutoTestSuite.json | ConvertFrom-Json -Depth 100
    
    $MyActualTestSuite | New-TestSuite
    
  • Or you can save the result of the New-TestSuite command with the -AutoGenerate switch parameter in a variable and update specific attributes of your auto-generated test suite. Then pipe the whole object back to the New-TestSuite command to create an actual test case.

    $MyAutoTestSuite = @{
      configs = @{
          propertyManager = @{
            propertyName = "my-property"
            propertyVersion = 1
          }
      }
      testRequestUrls = @("https://www.example.com")
    }
    
    $TestSuiteAuto = New-TestSuite -Body $MyAutoTestSuite -AutoGenerate
    
    $TestSuiteAuto.testSuiteName = "This test suite performs a basic check of www.example.com"
    $TestSuiteAuto.isStateful = $true
    $TestSuiteAuto.testCases[0].clientProfile.client = "CURL"
    $TestSuiteAuto.testCases[0].condition.conditionExpression = 'Caching option is cache with max-age of "7" days'
    $TestSuiteAuto.testCases[0].testRequest.requestMethod = "POST"
    $TestSuiteAuto.variables[0].variableName = "host"
    $TestSuiteAuto.variables[0].variableValue = "example.com"
    
    $ActualTestSuite = $TestSuiteAuto | New-TestSuite
    
    $MyAutoTestSuite = '{
      "configs": {
        "propertyManager": {
          "propertyId": 12345,
          "propertyVersion": 1
        }
      },
      "testRequestUrls": ["https://www.example.com"]
    }'
    
    $TestSuiteAuto = New-TestSuite -Body $MyAutoTestSuite -AutoGenerate
    
    $TestSuiteAuto.testSuiteName = "This test suite performs a basic check of www.example.com"
    $TestSuiteAuto.isStateful = $true
    $TestSuiteAuto.testCases[0].clientProfile.client = "CURL"
    $TestSuiteAuto.testCases[0].condition.conditionExpression = 'Caching option is cache with max-age of "7" days'
    $TestSuiteAuto.testCases[0].testRequest.requestMethod = "POST"
    $TestSuiteAuto.variables[0].variableName = "host"
    $TestSuiteAuto.variables[0].variableValue = "example.com"
    
    $ActualTestSuite = $TestSuiteAuto | New-TestSuite
    
    createdBy               : jsmith
    createdDate             : 5/7/2025 1:47:13 PM
    modifiedBy              : jsmith
    modifiedDate            : 5/7/2025 1:47:13 PM
    testSuiteId             : 12345
    testSuiteName           : This test suite performs a basic check of www.example.com
    isLocked                : True
    isStateful              : True
    executableTestCaseCount : 3
    configs                 : @{propertyManager=}
    testCases               : {@{createdBy=jsmith; createdDate=5/7/2025 1:47:16 PM; modifiedBy=jsmith; modifiedDate=5/7/2025 1:47:16 PM; testCaseId=12345; testRequest=; clientProfile=; condition=; order=1}, 
                              @{createdBy=jsmith; createdDate=5/7/2025 1:47:16 PM; modifiedBy=jsmith; modifiedDate=5/7/2025 1:47:16 PM; testCaseId=67890; testRequest=; clientProfile=; condition=; order=2}, 
                              @{createdBy=jsmith; createdDate=5/7/2025 1:47:16 PM; modifiedBy=jsmith; modifiedDate=5/7/2025 1:47:16 PM; testCaseId=98765; testRequest=; clientProfile=; condition=; order=3}}
    variables               : {@{createdBy=jsmith; createdDate=5/7/2025 1:47:13 PM; modifiedBy=jsmith; modifiedDate=5/7/2025 1:47:13 PM; variableId=12345; isDynamicallyUsed=False; variableName=path; 
                              variableValue=/}, @{createdBy=jsmith; createdDate=5/7/2025 1:47:13 PM; modifiedBy=jsmith; modifiedDate=5/7/2025 1:47:13 PM; variableId=67890; isDynamicallyUsed=False; 
                              variableName=host; variableValue=example.com}, @{createdBy=jsmith; createdDate=5/7/2025 1:47:13 PM; modifiedBy=jsmith; modifiedDate=5/7/2025 1:47:13 PM; 
                              variableId=98765; isDynamicallyUsed=False; variableName=protocol; variableValue=https}}
    

Update

  1. If you don't know your test suite ID, use the Get-TestSuite command to return the list of all test suites available to you.

    Optionally, you can add additional parameters to narrow down your results to a specific property, user, or recently deleted items. When specifying a property, you can provide either a property name with its version or a property ID with its version.

    For a specific test suite, pass the -TestSuiteID in the command. You can add optional parameters to decide whether you want a returned test suite to include child objects, such as test cases and variables, and test cases with resolved variables assigned statically.

    # Get all
    Get-TestSuite
    
    # Get all filtered
    Get-TestSuite -IncludeRecentlyDeleted -PropertyID 12345 -PropertyVersion 1 -User 'jsmith'
    
    # Get one
    Get-TestSuite -TestSuiteID 12345
    
     # Get one filtered
    Get-TestSuite -TestSuiteID 12345 -IncludeChildObjects -ResolveVariables
    
    createdBy               : jsmith
    createdDate             : 4/26/2025 11:18:07 AM
    modifiedBy              : jsmith
    modifiedDate            : 4/26/2025 11:18:07 AM
    testSuiteId             : 12345
    testSuiteName           : My-Test-Suite-1
    isLocked                : True
    isStateful              : False
    executableTestCaseCount : 0
    configs                 : @{propertyManager=}
    
    createdBy               : jsmith
    createdDate             : 2/25/2025 6:28:47 PM
    modifiedBy              : jsmith
    modifiedDate            : 2/25/2025 6:28:47 PM
    testSuiteId             : 98765
    testSuiteName           : My-Test-Suite-2
    testSuiteDescription    : This test suite performs a basic check of www.example.com
    isLocked                : True
    isStateful              : False
    executableTestCaseCount : 0
    
    createdBy               : jsmith
    createdDate             : 4/26/2025 11:18:07 AM
    modifiedBy              : jsmith
    modifiedDate            : 4/26/2025 11:18:07 AM
    testSuiteId             : 12345
    testSuiteName           : My-Test-Suite-1
    testSuiteDescription    : My Test 1
    isLocked                : True
    isStateful              : True
    executableTestCaseCount : 2
    configs                 : @{propertyManager=}
    testCases               : {@{createdBy=jsmith; createdDate=4/27/2025 10:31:12 AM; modifiedBy=jsmith; modifiedDate=4/27/2025 10:31:12 AM; testCaseId=12345; testRequest=; clientProfile=; condition=; 
                            order=1}, @{createdBy=jsmith; createdDate=4/28/2025 11:35:12 AM; modifiedBy=jsmith; modifiedDate=4/28/2025 11:35:12 AM; testCaseId=98765; testRequest=; clientProfile=; 
                            condition=; order=2}}
    variables               : {}
    
  2. Once you have the required test suite, save the result of the Get-TestSuite command in a variable and update specific attributes of your test suite, then pipe the whole object back to the Set-TestSuite command to make your changes effective.

    $MyTestSuite = Get-TestSuite -TestSuiteID 12345
    
    $MyTestSuite.isLocked = $true
    $MyTestSuite.isStateful = $true
    $MyTestSuite.testSuiteName = "My-Updated-Test-Suite"
    $MyTestSuite.configs.propertyManager.propertyId = 98765
    $MyTestSuite.configs.propertyManager.propertyVersion = 1
    
    $MyTestSuite | Set-TestSuite -TestSuiteID 12345
    

    Alternatively, you can retrieve a specific record, save its output locally, and edit it as needed.

    Get-TestSuite -TestSuiteID 12345 | ConvertTo-Json -Depth 100 | Out-File -FilePath ./myTestSuite.json
    
    {
       "createdBy": "jsmith",
       "createdDate": "2025-04-26T13:47:13+02:00",
       "modifiedBy": "jsmith",
       "modifiedDate": "2025-04-26T14:11:42+02:00",
       "testSuiteId": 12345,
       "testSuiteName": "My-Test-Suite-1",
       "isLocked": true,
       "isStateful": true,
       "executableTestCaseCount": 2,
       "configs": {
         "propertyManager": {
           "propertyId": 12345,
           "propertyName": "my-property",
           "propertyVersion": 1
         }
       }
     }
    

    Then convert it back to a PowerShell object and pipe it to the Set-TestSuite command along with the required ID.

    $MyTestSuite = Get-Content ./myTestSuite.json | ConvertFrom-Json -Depth 100
    
    $MyTestSuite | Set-TestSuite -TestSuiteID 12345
    
    createdBy               : jsmith
    createdDate             : 4/26/2025 11:18:07 AM
    modifiedBy              : jsmith
    modifiedDate            : 5/5/2025 12:55:12 PM
    testSuiteId             : 12345
    testSuiteName           : My-Test-Suite-1
    isLocked                : False
    isStateful              : False
    executableTestCaseCount : 0
    configs                 : @{propertyManager=}
    

    With the Set-TestSuite command, you can update a test suite with or without the included test cases and variables.

Delete

To delete an existing test suite, pass its ID in the Remove-TestSuite command. The command doesn't return any output.

Remove-TestSuite -TestSuiteID 12345

Restore

You can restore a deleted test suite and the included child objects with the Restore-TestSuite command. Note that you can run this operation only for those test suites that were deleted no later than 30 days from their deletion date.

Restore-TestSuite -TestSuiteID 12345
createdBy               : jsmith
createdDate             : 4/26/2025 11:18:07 AM
modifiedBy              : jsmith
modifiedDate            : 5/5/2025 1:23:28 PM
testSuiteId             : 12345
testSuiteName           : My-Test-Suite-1
isLocked                : False
isStateful              : False
executableTestCaseCount : 0
configs                 : @{propertyManager=}

Manage variables in a test suite

Variables allow you to reuse specific values in test cases' input fields, including a test request's testRequestUrl, headerName, headerValue, requestBody, or conditionExpression. A single variable appears with the {{variableName}} syntax and a variable group with the {{variableName.columnHeader}} syntax.

You can assign variables statistically and dynamically. To learn more, see Assigning values to variables.

Create

Each variable consists of a name and an assigned value. To create a variable for a test suite, run the New-TestVariable command. In the -Body parameter, specify either a single variable or a variable group or both as a hashtable, PSCustomObject, or JSON string. Then pass the defined settings in the -Body parameter of the New-TestVariable command.

Optionally, add the -IncludeStatus switch parameter to the command to return response metadata with your successes object.

Argument Required Description
Single variable
variableName The variable's name.
variableValue The variable's value.
Variable group
variableName The variable's name.
variableGroupValue Variable groups created in a specific test suite and their details.
  • columnHeader. Required. The column header's name.
  • columnValues. The column's values for a specific column header.
$MyVariables = @(
  @{
    variableName = "redirectCode"
    variableValue = "301"
  }
  @{
    variableName = "redirect"
    variableGroupValue = @(
      @{
        columnHeader = "sourceUrl"
        columnValues = @(
          "https://www.example.com/"
        )
      }
      @{
        columnHeader = "redirectUrl"
        columnValues = @(
          "https://www.other-example.com/"
        )
      }
    )
  }
)

New-TestVariable -TestSuiteID 12345 -Body $MyVariables
$MyVariables = '[
  {
    "variableName": "redirectCode",
    "variableValue": "301"
  },
  {
    "variableName": "redirect",
    "variableGroupValue": [
      {
        "columnHeader": "sourceUrl",
        "columnValues": [
          "https://www.example.com"
        ]
      },
      {
        "columnHeader": "redirectUrl",
        "columnValues": [
          "https://www.other-example.com"
        ]
      }
    ]
  }
]'

New-TestVariable -TestSuiteID 12345 -Body $MyVariables
createdBy         : jsmith
createdDate       : 5/6/2025 1:32:12 PM
modifiedBy        : jsmith
modifiedDate      : 5/6/2025 1:32:12 PM
variableId        : 12345
isDynamicallyUsed : False
variableName      : redirectCode
variableValue     : 301

createdBy          : jsmith
createdDate        : 5/6/2025 1:32:12 PM
modifiedBy         : jsmith
modifiedDate       : 5/6/2025 1:32:12 PM
variableId         : 98765
variableName       : redirect
variableGroupValue : {@{columnHeader=sourceUrl; columnValues=System.Object[]}, @{columnHeader=redirectUrl; 
                     columnValues=System.Object[]}}

Update

  1. If you don't know your variable ID, run the Get-TestVariable command to return all variables for a given test suite.

    To get a specific variable, pass its ID in the command.

    # Get all
    Get-TestVariable -TestSuiteID 12345
    
    # Get one
    Get-TestVariable -TestSuiteID 12345 -VariableID 98765
    
    createdBy          : jsmith
    createdDate        : 5/6/2025 1:32:12 PM
    modifiedBy         : jsmith
    modifiedDate       : 5/6/2025 1:32:12 PM
    variableId         : 12345
    variableName       : redirect
    variableGroupValue : {@{columnHeader=sourceUrl; columnValues=System.Object[]}, @{columnHeader=redirectUrl; 
                         columnValues=System.Object[]}}
    
    createdBy         : jsmith
    createdDate       : 5/6/2025 1:32:12 PM
    modifiedBy        : jsmith
    modifiedDate      : 5/6/2025 1:32:12 PM
    variableId        : 98765
    isDynamicallyUsed : False
    variableName      : redirectCode
    variableValue     : 301
    
    createdBy         : jsmith
    createdDate       : 5/6/2025 1:32:12 PM
    modifiedBy        : jsmith
    modifiedDate      : 5/6/2025 1:32:12 PM
    variableId        : 98765
    isDynamicallyUsed : False
    variableName      : redirectCode
    variableValue     : 301
    
  2. To update the required variable, save the result of the Get-TestVariable command in a variable and update specific attributes of your variable, then pipe the whole object back to the Set-TestVariable command to make your changes effective.

    $myVariable = Get-TestVariable -TestSuiteID 12345 -VariableID 98765
    
    $myVariable.variableName = "newRedirectCode"
    $myVariable.variableValue = "302"
    
    $myVariable | Set-TestVariable -TestSuiteID 12345
    

    Alternatively, you can get a specific record, save its output locally, and edit it as needed.

    Get-TestVariable -TestSuiteID 12345 -VariableID 98765 | ConvertTo-Json -Depth 100 | Out-File -FilePath ./myVariable.json
    
     {
       "createdBy": "jsmith",
       "createdDate": "2025-05-06T13:32:12+02:00",
       "modifiedBy": "jsmith",
       "modifiedDate": "2025-05-06T13:32:12+02:00",
       "variableId": 19526,
       "isDynamicallyUsed": false,
       "variableName": "redirectCode",
       "variableValue": "301
     }
    

    Then convert it back to a PowerShell object and pipe it to the Set-TestVariable command along with the required test suite ID.

    $myVariable = Get-Content ./myVariable.json | ConvertFrom-Json -Depth 100
    
    $myVariable | Set-TestVariable -TestSuiteID 12345
    
    createdBy         : jsmith
    createdDate       : 5/6/2025 1:32:12 PM
    modifiedBy        : jsmith
    modifiedDate      : 5/7/2025 11:11:46 AM
    variableId        : 98765
    isDynamicallyUsed : False
    variableName      : newRedirectCode
    variableValue     : 302
    

Delete

To remove a variable from a test suite, run the Remove-TestVariable command specifying the variable ID you want to remove.

Optionally, you can add the -IncludeStatus switch parameter to the command to return response metadata and the usual successes object.

You can't delete variables that are in use.

Remove-TestVariable -TestSuiteID 12345 -VariableID 98765 -IncludeStatus
successes failures
--------- --------
{98765}   {}

Configure a test case

A test case in functional testing is the basic unit of testing. It includes all settings the test needs to be run: a condition, a test request, and a client profile. You can combine a few test cases in a test suite.

Create

When creating a new test case within a test suite, define its required settings, including a test request, client profile, and condition in a variable as a hashtable, PSCustomObject, or JSON string. Then pass the variable in the -Body parameter of the New-TestCase command.

Optionally, pass the -IncludeStatus switch parameter in the command to return response metadata with your successes object.

If you want to use variables within a condition or test request's URL or request header, create a new variable first.

Argument Required Description
clientProfile A client profile included in the test case.
  • client. Required. The client type you want to use for the test run, either CHROME or CURL.
  • ipVersion. Required. The IP version to use in the test run, either IPV4 or IPV6.
  • geoLocation. The location type you want to use for the test run. Currently, US is the only supported value.
Note: The client profile of a test case you want to add needs to match with the existing associated test cases.
condition Includes the conditionExpression you want to evaluate in the test run. Run the Get-TestCatalogTemplate command to get the template for creating a specific condition statement. Each condition type from this operation contains:
  • The condition expression explaining the structure of the supported condition statement. Some statements require your input; the required values are in "".
  • The examples of how to correctly implement the condition statement.
  • The supported values you can include in the condition statement.
To learn more about each condition type, see the list of available conditions.
testRequest A test request included in the test case.
  • testRequestUrl. Required. A fully qualified URL of the page or object you want to test. The URL needs to include a protocol, a hostname, a path, and any optional query parameters.
  • requestMethod. Required. A request method for the testRequestUrl. The available values are HEAD, GET, and POST. HEAD and POST request methods are allowed only with the CURL client.
  • encodeRequestBody. When set to true, this encodes requestBody. It applies only if clientType is set to CURL and requestMethod to POST. It's true by default if not set.
  • requestBody. The request body for the testRequestUrl. Provide it only if clientType is set to CURL and requestMethod is POST.
  • requestHeaders. Requests or Akamai Pragma headers included in the functional test case. See Pragma headers for the list of supported values. This parameter includes:
    • headerAction. Required. The request header's settings. Possible values:
      • ADD. Adds the entered request headers.
      • MODIFY. Modifies the existing request headers.
      • FILTER. Filters the entered request headers.
    • headerName. Required. The request header's name.
    • headerValue. Required. The request header's value.
  • tags. Keywords for the test request. They're useful to filter test cases in the Test Center application.
setVariables Test case variables to resolve at runtime. To learn more, see Variables.
  • variableName. Required. A name for the variable created in a given test suite. To get this value, run the Get-TestVariable command.
  • variableValue. Required. A value of the variable to resolve at runtime.
$MyNewTestCase = @{
  testRequest = @{
    requestMethod = "GET"
    requestBody = ""
    testRequestUrl = "https://www.example.com"
    encodeRequestBody = $false
    requestHeaders = @(
      @{
        headerName = "Accept"
        headerValue = "v1"
        headerAction = "ADD"
      }
    )
  }
  condition = @{
    conditionExpression = 'Response code is one of "200"'
  }
  clientProfile = @{
    client = "CHROME"
    ipVersion = "IPV4"
  }
  setVariables = @(
    @{
      variableName = "host"
      variableValue = "www.example.com"
    }
    @{
      variableName = "protocol"
      variableValue = "https"
    }
    @{
      variableName = "path"
      variableValue = "/"
    }
  )
}

New-TestCase -TestSuiteID 12345 -Body $MyNewTestCase
$MyNewTestCase = '{
  "testRequest": {
    "requestMethod": "GET",
    "requestBody": "",
    "testRequestUrl": "https://www.example.com",
    "encodeRequestBody": false,
    "requestHeaders": [
      {
        "headerName": "Accept",
        "headerValue": "v1",
        "headerAction": "ADD"
      }
    ]
  },
  "condition": {
    "conditionExpression": "Response code is one of \"200\""
  },
  "clientProfile": {
    "client": "CHROME",
    "ipVersion": "IPV4"
  },
  "setVariables": [
    {
      "variableName": "host",
      "variableValue": "www.example.com"
    },
    {
      "variableName": "protocol",
      "variableValue": "https"
    },
    {
      "variableName": "path",
      "variableValue": "/"
    }
  ]
}'

New-TestCase -TestSuiteID 12345 -Body $MyNewTestCase
createdBy     : jsmiith
createdDate   : 5/7/2025 10:11:45 AM
modifiedBy    : jsmiith
modifiedDate  : 5/7/2025 10:11:45 AM
testCaseId    : 98765
testRequest   : @{testRequestUrl=https://www.example.com/; requestMethod=GET; requestHeaders=System.Object[]}
clientProfile : @{client=CHROME; ipVersion=IPV4; geoLocation=US}
condition     : @{conditionExpression=Response code is one of "200"}
order         : 1
setVariables  : {@{variableId=12345; variableName=path; variableValue=/}, @{variableId=67890; variableName=protocol; variableValue=https}, @{variableId=98765; variableName=host; 
                variableValue=www.example.com}}

Update

  1. If you don't know your test case ID, use the Get-TestCase command to return the list of all test cases available for a given test suite. You can add optional switch parameters to narrow down your list, for example, to decide whether to include test cases deleted within the last 30 days or test cases with resolved variables assigned statically.

    For a specific test case, pass its ID in the command.

    # Get all
    Get-TestCase -TestSuiteID 12345
    
    # Get all filtered
    Get-TestCase -TestSuiteID 12345 -IncludeRecentlyDeleted -ResolveVariables
    
    # Get one
    Get-TestCase -TestSuiteID 12345 -TestCaseID 98765
    
     createdBy     : jsmith
     createdDate   : 5/7/2025 9:47:16 AM
     modifiedBy    : jsmith
     modifiedDate  : 5/7/2025 9:47:16 AM
     testCaseId    : 12345
     testRequest   : @{testRequestUrl={{protocol}}://{{host}}{{path}}; requestMethod=GET}
     clientProfile : @{client=CHROME; ipVersion=IPV4; geoLocation=US}
     condition     : @{conditionExpression=Content provider code is "1600967"}
     order         : 1
    
     createdBy     : jsmith
     createdDate   : 5/7/2025 10:11:45 AM
     modifiedBy    : jsmith
     modifiedDate  : 5/7/2025 10:11:45 AM
     testCaseId    : 98765
     testRequest   : @{testRequestUrl=https://www.example.com/; requestMethod=GET; requestHeaders=System.Object[]}
     clientProfile : @{client=CHROME; ipVersion=IPV4; geoLocation=US}
     condition     : @{conditionExpression=Response code is one of "200"}
     order         : 2
     setVariables  : {@{variableId=12345; variableName=path; variableValue=/}, @{variableId=6789; variableName=protocol; variableValue=https}, @{variableId=98765; variableName=host; 
                 variableValue=www.example.com}}
    
     createdBy     : jsmith
     createdDate   : 5/7/2025 10:11:45 AM
     modifiedBy    : jsmith
     modifiedDate  : 5/7/2025 10:11:45 AM
     testCaseId    : 98765
     testRequest   : @{testRequestUrl=https://www.example.com/; requestMethod=GET; requestHeaders=System.Object[]}
     clientProfile : @{client=CHROME; ipVersion=IPV4; geoLocation=US}
     condition     : @{conditionExpression=Response code is one of "200"}
     order         : 2
     setVariables  : {@{variableId=12345; variableName=path; variableValue=/}, @{variableId=6789; variableName=protocol; variableValue=https}, @{variableId=98765; variableName=host; 
                 variableValue=www.example.com}}
    
  2. Once you have the required test case, save the result of the Get-TestCase command in a variable and update specific attributes of your test case, then pipe the whole object back to the Set-TestCase command to make your changes effective.

    $MyTestCase = Get-TestCase -TestSuiteID 12345 -TestCaseID 98765
    
    $MyTestCase.condition.conditionExpression = 'Response code is one of "404"'
    $MyTestCase.testRequest.requestHeaders[0].headerAction = "MODIFY"
    $MyTestCase.setVariables[2].variableName = "newHost"
    
    $MyTestCase | Set-TestCase -TestSuiteID 12345
    
  3. Alternatively, you can get a specific record, save its output locally, and edit it as needed.

    Get-TestCase -TestSuiteID 12345 -TestCaseID 98765 | ConvertTo-Json -Depth 100 | Out-File -FilePath ./myTestCase.json
    
    {
       "createdBy": "jsmith",
       "createdDate": "2025-05-07T10:10:45+02:00",
       "modifiedBy": "jsmith",
       "modifiedDate": "2025-05-07T10:10:45+02:00",
       "testCaseId": 98765,
       "testRequest": {
         "testRequestUrl": "https://www.example.com/",
         "requestMethod": "GET",
         "requestHeaders": [
           {
             "headerName": "Accept",
             "headerValue": "v1",
             "headerAction": "ADD"
           }
         ]
       },
       "clientProfile": {
         "client": "CHROME",
         "ipVersion": "IPV4",
         "geoLocation": "US"
       },
       "condition": {
         "conditionExpression": "Response code is one of \"200\""
       },
       "order": 2,
       "setVariables": [
         {
           "variableId": 12345,
           "variableName": "path",
           "variableValue": "/"
         },
         {
           "variableId": 6789,
           "variableName": "protocol",
           "variableValue": "https"
         },
         {
           "variableId": 98765,
           "variableName": "host",
           "variableValue": "www.example.com"
         }
       ]
     }
    

    Then convert it back to a PowerShell object and pipe it to the Set-TestCase command along with the required ID.

    $MyTestCase = Get-Content ./myTestCase.json | ConvertFrom-Json -Depth 100
    
    $MyTestCase | Set-TestCase -TestSuiteID 12345
    
     createdBy     : jsmith
     createdDate   : 5/7/2025 10:11:45 AM
     modifiedBy    : jsmith
     modifiedDate  : 5/7/2025 11:03:53 AM
     testCaseId    : 98765
     testRequest   : @{testRequestUrl=https://www.example.com/; requestMethod=GET; requestHeaders=System.Object[]}
     clientProfile : @{client=CHROME; ipVersion=IPV4; geoLocation=US}
     condition     : @{conditionExpression=Response code is one of "404"}
     order         : 2
     setVariables  : {@{variableId=12345; variableName=path; variableValue=/}, @{variableId=67890; variableName=protocol; variableValue=https}, @{variableId=98765; variableName=newHost; 
                 variableValue=www.example.com}}
    

Reorder

This applies only when running a test for stateful test suites.

Before you reorder your test cases, run the Get-TestCase command to verify their current order.

To reorder test cases in a test suite, run the Set-TestCaseOrder command. In the -Body parameter, provide the target order for all test cases included in a test suite, specifying the order of a given test case and its ID.

$MyNewTestCaseOrder = @(
  @{
    order = 1
    testCaseId = 12345
  }
  @{
    order = 2
    testCaseId = 98765
  }
)

Set-TestCaseOrder -TestSuiteID 12345 -Body $MyNewTestCaseOrder
$MyTestCaseOrder = '[
  {
    "order": 2,
    "testCaseId": 12345
  },
  {
    "order": 1,
    "testCaseId": 98765
  }
]'

Set-TestCaseOrder -TestSuiteID 12345 -Body $MyNewTestCaseOrder
testCaseId order
---------- -----
     98765     1
     12345     2

Delete

To delete an existing test case within a test suite, pass the test suite and test case IDs in the Remove-TestCase command.

Optionally, you can add the -IncludeStatus switch parameter to the command to return response metadata and the usual successes object.

Remove-TestCase -TestSuiteID 12345 -TestCaseId 98765 -IncludeStatus
successes failures
--------- --------
{98765}   {}

Restore

You can restore a deleted test case within a given test suite using the Restore-TestCase command. Note that you can run this operation only for those test cases that were deleted no later than 30 days from their deletion date.

Restore-TestCase -TestSuiteID 12345 -TestCaseId 98765
createdBy     : jsmith
createdDate   : 5/7/2025 10:11:45 AM
modifiedBy    : jsmith
modifiedDate  : 5/7/2025 11:03:53 AM
deletedBy     : jsmith
deletedDate   : 5/8/2025 2:35:40 PM
testCaseId    : 98765
testRequest   : @{testRequestUrl=https://www.example.com/; requestMethod=GET; requestHeaders=System.Object[]}
clientProfile : @{client=CHROME; ipVersion=IPV4; geoLocation=US}
condition     : @{conditionExpression=Response code is one of "404"}
setVariables  : {@{variableId=12345; variableName=path; variableValue=/}, @{variableId=67890; variableName=protocol; variableValue=https}, @{variableId=98765; variableName=newHost; 
                variableValue=www.example.com}}

Run a test

Once you're all set, submit a test run with the New-TestRun command. With this one command, you can run a test for a property version, test suite, or functional test case.

When submitting a new test run, define its required settings in a variable as a hashtable, PSCustomObject, or JSON string. Then pass the variable in the -Body parameter of the New-TestRun command.

Argument Required Description
functional The functional testing objects you want the test run to execute. Depending on what you want to run the functional test for, it may include propertyManagerExecution, testSuiteExecutions, or testCaseExecutions.
  • propertyManagerExecution. A property associated with a test suite you want to execute.
    • propertyVersion. Required. Your property's version number.
    • propertyId. Your property's ID.
    • propertyName. Your property's name.
    Note: When specifying a property, you can provide either a property name with its version or a property ID with its version.
  • testCaseExecution. The functional test case and included objects: a condition, a test request, and a client profile.
    • clientProfile. Required. A client profile included in the test case.
      • client. Required. The client type you want to use for the test run, either CHROME or CURL.
      • ipVersion. Required. The IP version to use in the test run, either IPV4 or IPV6.
      • geoLocation. The location type you want to use for the test run. Currently, US is the only supported value.
    • condition. Required. Includes the conditionExpression you want to evaluate in the test run. Run the Get-TestCatalogTemplate command to get the template for creating a specific condition statement. Each condition type from this operation contains:
      • The condition expression explaining the structure of the supported condition statement. Some statements require your input; the required values are in "".
      • The examples of how to correctly implement the condition statement.
      • The supported values you can include in the condition statement.
      To learn more about each condition type, see the list of available conditions.
    • testRequest. Required. A test request included in the test case.
      • testRequestUrl. Required. A fully qualified URL of the page or object you want to test. The URL needs to include a protocol, a hostname, a path, and any optional query parameters.
      • requestMethod. Required. A request method for the testRequestUrl. The available values are HEAD, GET, and POST.
      • encodeRequestBody. When set to true, this encodes requestBody. It applies only if clientType is set to CURL and requestMethod to POST. It's true by default if not set.
      • requestBody. The request body for the testRequestUrl. Provide it only if clientType is set to CURL and requestMethod is POST.
      • requestHeaders. Requests or Akamai Pragma headers included in the functional test case. See Pragma headers for the list of supported values. This parameter includes:
        • headerAction. Required. The request header's settings. Possible values:
          • ADD. Adds the entered request headers.
          • MODIFY. Modifies the existing request headers.
          • FILTER. Filters the entered request headers.
        • headerName. Required. The request header's name.
        • headerValue. Required. The request header's value.
      • tags. Keywords for the test request. They're useful to filter test cases in the Test Center application.
  • testSuiteExecutions. Test suites you want to execute during the test run.
    • testSuiteId. Required. The test suite's ID included in the test suite you want to execute.
    • testCaseExecutions. Test case IDs included in the test suite you want to execute. If omitted, Test Center executes all test cases in the test suite.
      • testCaseId. Required. The test suite's ID included in the test suite you want to execute.
targetEnvironment The environment against which the test run executes the request, either STAGING or PRODUCTION.
purgeOnStaging When set to true, this purges the configuration for the test run. It applies only for targetEnvironment set to STAGING.
sendEmailOnCompletion When set to true, this sends a notification email after the test run completes.
note A human-readable note about the test run.

For a test case

$MyTestRunForTestCase = @{
  functional = @{
    testCaseExecution = @{
      clientProfile = @{
        client = "CHROME"
        ipVersion = "IPV4"
      }
      condition = @{
        conditionExpression = 'Response code is one of "200"'
      }
      testRequest = @{
        requestMethod = "GET"
        testRequestUrl = "https://www.example.com"
      }
    }
  }
  targetEnvironment = "STAGING"
  sendEmailOnCompletion = $true
  purgeOnStaging = $true
  note = "Test for GET on www.example.com"
}

New-TestRun -Body $MyTestRunForTestCase
$MyTestRunForTestCase = '{
  "functional": {
    "testCaseExecution": {
      "clientProfile": {
        "client": "CHROME",
        "ipVersion": "IPV4"
      },
      "condition": {
        "conditionExpression": "Response code is one of \"200\""
      },
      "testRequest": {
        "requestMethod": "GET",
        "testRequestUrl": "https://example.com"
      }
    }
  },
  "targetEnvironment": "STAGING",
  "sendEmailOnCompletion": true,
  "purgeOnStaging": true,
  "note": "Test for GET on www.example.com"
}'

New-TestRun -Body $MyTestRunForTestCase
submittedBy       : jsmith
submittedDate     : 5/7/2025 4:11:47 PM
testRunId         : 12345
targetEnvironment : STAGING
note              : Test for GET on www.example.com
status            : IN_PROGRESS
functional        : @{testCaseExecution=; status=IN_PROGRESS; allExecutionObjectsIncluded=False}

For a test suite

$MyTestRunForTestSuite = @{
  functional = @{
    testSuiteExecutions = @(
      @{
        testSuiteId = 12345
        testCaseExecutions = @(
          @{
            testCaseId = 98765
          }
        )
      }
    )
  }
  targetEnvironment = "STAGING"
  purgeOnStaging = $true
  sendEmailOnCompletion = $true
  note = "Testing the www.example.com test suite"
}

New-TestRun -Body $MyTestRunForTestSuite
$MyTestRunForTestSuite = '{
  "functional": {
    "testSuiteExecutions": [
      {
        "testSuiteId": 12345,
        "testCaseExecutions": [
          {
            "testCaseId": 98765
          }
        ]
      }
    ]
  },
  "targetEnvironment": "STAGING",
  "purgeOnStaging": true,
  "sendEmailOnCompletion": true,
  "note": "Testing the www.example.com test suite"
}'

New-TestRun -Body $MyTestRunForTestSuite
submittedBy       : jsmith
submittedDate     : 5/7/2025 4:19:39 PM
testRunId         : 12345
targetEnvironment : STAGING
note              : Testing the www.example.com test suite
status            : IN_PROGRESS
functional        : @{testSuiteExecutions=System.Object[]; status=IN_PROGRESS; allExecutionObjectsIncluded=False}

For a property version

$MyTestRunForProperty = @{
  functional = @{
    propertyManagerExecution = @{
      propertyName = "my-property"
      propertyVersion = 1
    }
  }
  targetEnvironment = "STAGING"
  purgeOnStaging = $true
  sendEmailOnCompletion = $true
  note = "Testing the www.example.com v1 property"
}

New-TestRun -Body $MyTestRunForProperty
$MyTestRunForProperty = '{
  "functional": {
    "propertyManagerExecution": {
      "propertyName": "my-property",
      "propertyVersion": 1
    }
  },
  "targetEnvironment": "STAGING",
  "purgeOnStaging": true,
  "sendEmailOnCompletion": true,
  "note": "Testing the www.example.com v1 property"
}'

New-TestRun -Body $MyTestRunForProperty
submittedBy       : jsmith
submittedDate     : 5/7/2025 4:34:10 PM
testRunId         : 12345
targetEnvironment : STAGING
note              : Testing the www.example.com v1 property
status            : IN_PROGRESS
functional        : @{propertyManagerExecution=; status=IN_PROGRESS; allExecutionObjectsIncluded=False}

To retrieve the details of your test runs, run the Get-TestRun command.

For a specific test run, pass its ID in the command. Optionally, add switch parameters, for example, to include the test run context, details of objects skipped during the test run, or audit information for a test run on test cases and test suites.

## Get all
Get-TestRun

# Get one
Get-TestRun -TestRunID 12345 -IncludeContext -IncludeSkipped -IncludeAuditInfoInContext
submittedBy       : jsmith
submittedDate     : 5/7/2025 4:34:10 PM
testRunId         : 12345
targetEnvironment : STAGING
note              : Testing the www.example.com v1 property
status            : IN_PROGRESS
purgeInfo         : @{status=COMPLETED}
functional        : @{status=IN_PROGRESS; allExecutionObjectsIncluded=False}

submittedBy       : jsmith
submittedDate     : 5/7/2025 4:19:39 PM
completedDate     : 5/7/2025 4:22:30 PM
testRunId         : 98765
targetEnvironment : STAGING
note              : Testing the www.example.com test suite
status            : COMPLETED_WITH_UNEXPECTED_RESULTS
purgeInfo         : @{status=COMPLETED}
functional        : @{status=COMPLETED_WITH_UNEXPECTED_RESULTS; allExecutionObjectsIncluded=False}
submittedBy       : jsmith
submittedDate     : 5/7/2025 4:34:10 PM
testRunId         : 12345
targetEnvironment : STAGING
note              : Testing the www.example.com v1 property
status            : IN_PROGRESS
purgeInfo         : @{status=COMPLETED}
functional        : @{propertyManagerExecution=; status=IN_PROGRESS; allExecutionObjectsIncluded=True}