Create a Test

API Explorer: /tests

To create a test:

  1. Create the test object with a POST to the test endpoint (see sample code).
  2. Capture the testId returned as id from the response.
  3. Upload test assets (such as scripts, data files or YAML Taurus configuration files) by using the testId and the code explained in the Upload or Update Asset Files section.
Once created, a test can be executed as part of any of your workflows, so make sure to save the id attribute value for later use. This testId will be used as a parameter to identify the test.

Create a Test Request Attributes

The following parameters are the base parameters required to create a test. See the Test Attributes for a complete list of parameters.

Attributes

  • namestring

    required

    The test name

  • configurationobject

    Contains all the advanced BlazeMeter related configurations (the running file, JMeter properties, and so on)

Create a Test

curl 'https://a.blazemeter.com/api/v4/tests' \
    -X POST \
    -H 'Content-Type: application/json' \
    --user 'api_key_id:api_key_secret' \
    -d '{"name": "V4 Create Test Through API", "configuration": {"type": "taurus", "filename": "DemoTest.jmx", "testMode": "script", "scriptType": "jmeter"}}'

The following JSON sample provides a more readable version of the content contained in the above curl example. This example represents the attributes and values contained in the -d flag of the curl example.

Create a TestCreate a Test POST Body (JSON)

{
    "name": "Minimum_Required_Configuration_Sample",
    "configuration": {
        "type": "taurus",
        "filename": "DemoTest.jmx",
        "testMode": "script",
        "scriptType": "jmeter"
    }
}

Create a Test Response Attributes

For the full details of all the attributes for the Performance Test, you can visit The Test Object.

Response201 Created

{
    "api_version": 4,
    "error": null,
    "result": {
        "id": 1234567,
        "name": "Minimum_Required_Configuration_Sample",
        "isNewTest": true,
        "userId": 123456,
        "created": 1551391783,
        "updated": 1551391783,
        "creatorClientId": "api",
        "overrideExecutions": [],
        "shouldSendReportEmail": true,
        "projectId": 123456,
        "lastUpdatedById": 123456,
        "configuration": {
            "type": "taurus",
            "executionType": "taurusCloud",
            "filename": "DemoTest.jmx",
            "testMode": "script",
            "scriptType": "jmeter"
        }
    }
}