XTC v76

2023-12-12

Platform

  • The user’s Home Dashboard has been enhanced with the new section Last Accessed Projects. It displays up to six of the most recently visited projects. Use this feature to quickly navigate to projects that you know you have recently accessed. Archived projects will not appear in the list.
  • Previously, once an organization logo was uploaded, it could be replaced with another, but not removed. The same was true for the user avatars. This is now fixed.

Load Testing

  • Load testing project dashboard improvements:
    • The project title has been removed and the Refresh button has been moved to the subheader.
    • Pie chart labels have been localized properly.
    • The states in the Load Tests by State pie chart have been given their own colors.
    • There is a new activity chart showing the number of load tests per day over the last six months.
  • Comparison report feature enhancements:
    • When creating a comparison report from two selected source reports, the report for the older load test automatically becomes the baseline report. If you want to swap the baseline and measurement run reports, check the new Reverse Order checkbox in the Create Comparison Report dialog.
    • The Baseline and Measurement Run table columns now display custom report labels, if any were specified at the source report.
  • The steps on the Status tab of a load test have been renamed and descriptions added.
  • As previously announced, the XLT 6.x execution environment has been retired.
  • Currently available XLT execution environments:

Feature Preview: Programmatic Access to XTC

Overview

XTC 76 ships with the first part of an API to get access to selected XTC resources and trigger selected operations from automated environments. This part provides remote access to load tests. This includes listing and inspecting load tests, duplicating and executing load tests, and downloading result and report archives.

In addition to the API itself, we have added functionality for administrators to manage API client credentials in both organization and projects. These credentials are used to obtain a temporary access token needed to make the actual API requests.

Managing API Client Credentials

To allow remote access to your load tests, you must first create client credentials. You can do this in your organization or in your projects.

To create client credentials in your organization, go to Configuration > Integrations > API Client Credentials and click the Add button. You will need to specify a name and an optional expiration date. You will also need to select an API version and the scopes (purposes) for which these credentials will be used. Submit the dialog and XTC will show you the generated client secret, which you can now copy to a safe place.

The client credentials defined in your organization are valid for accessing resources in your organization and, by default, in all of your projects. However, org credentials can be disabled in your project(s). Go to Configuration > Integrations > API Client Credentials in a project and disable the org client credentials for that project if necessary.

In the same location, you can also create project-level API client credentials, similar to the org-level credentials as described above. These credentials will only allow access to the resources of that project.

Whether you use org-level or project-level credentials, or a mix of both, depends on your security requirements.

Obtaining an Access Token

To actually use the API, you need an access token. To get one in an automated way, use the tool of your choice, but we will demonstrate this using curl:

curl -X POST \
     -d "client_id=<your-client-id>" \
     -d "client_secret=<your-client-secret>" \
     -d "grant_type=client_credentials" \
     -d "scope=LOADTEST_LIST LOADTEST_STATUS LOADTEST_DETAILS LOADTEST_COPY_RUN LOADTEST_REPORT_DOWNLOAD LOADTEST_RESULT_DOWNLOAD" \
     https://xtc.xceptance.com/oauth/token

As you can see, you need to pass both the client ID and secret, but also the grant type client_credentials and the scopes for which this token will be used. The scope list may contain fewer scopes than defined in the credentials, but no more.

Now run the curl command. XTC will return a JSON response. Look for the access_token field. Note that this access token expires automatically after one hour, but you can create new tokens at any time.

Making API Calls

Now we are ready to make our first API call: listing all the load tests in a project. Don’t forget to provide the access token and the short names of your organization and project:

curl -X GET \
     -H "Authorization: Bearer <your-jwt-access-token>" \
     https://xtc.xceptance.com/public/api/v1/orgs/<org-short-name>/projects/<project-short-name>/loadTests

If all went well, you should see a JSON response with all your load tests printed to the console.

For your convenience, here is a list of all the API endpoints and what they are used for:

  • List all load tests in a project:
    /public/api/v1/orgs/<org-short-name>/projects/<project-short-name>/loadTests
  • List the details of a certain load test:
    /public/api/v1/orgs/<org-short-name>/projects/<project-short-name>/loadTests/<load-test-number>
  • List the status of a certain load test:
    /public/api/v1/orgs/<org-short-name>/projects/<project-short-name>/loadTests/<load-test-number>/status
  • Copy the specified load test and run the copy:
    /public/api/v1/orgs/<org-short-name>/projects/<project-short-name>/loadTests/<load-test-number>/runCopy
  • Download the specified report archive:
    /public/api/v1/orgs/<org-short-name>/projects/<project-short-name>/loadTests/<load-test-number>/reports/<report-number>/download
  • Download the specified result archive:
    /public/api/v1/orgs/<org-short-name>/projects/<project-short-name>/loadTests/<load-test-number>/results/<result-number>/download

For a complete formal documentation, visit https://xtc.xceptance.com/public/api/json or https://xtc.xceptance.com/public/api/yaml. There you will find the OpenAPI-compliant specification of all existing API endpoints, including their respective request and response types, in either JSON or YAML format.

Last modified February 6, 2024