Create a Test
API Explorer: /tests
To create a test:
- Create the test object with a POST to the test endpoint (see sample code).
- Capture the
testIdreturned asidfrom the response. - Upload test assets (such as scripts, data files or YAML Taurus configuration files) by using the
testIdand 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
-
namestringrequired
The test name
-
configurationobjectContains all the advanced BlazeMeter related configurations (the running file, JMeter properties, and so on)
Show/Hide Child Attributes
-
typestringrequired
The test type, that is,
taurus. -
filenamestringrequired
The name of the file (JMeter script, Taurus YAML configuration file, and so on) that will be used in the test. For example,
BlazeDemoTest.jmx. Note: You must also upload the file, for more information, see Upload or Update Asset Files -
testModestringrequired
The test mode this test will use. Can be the following values:
script- Use when uploading your own script (Taurus YAML configuration, JMeter script, and so on)http- Used for URL tests in BlazeMeter -
scriptTypestringrequired
The script types available. Includes:
apiritifgatlinggrinderjmeterlocustnosepbenchpytestrobotseleniumsiegetaurus
-
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"
}
}
}