Follow

Create a Test

Description

This API enables you to create a test which will be available for future uses. In order to complete the test creation you will need to use the POST tests/files API in order to upload the test's assets, mainly the JMX.
This function includes a parameter to identify the user.

URL

https://a.blazemeter.com:443/api/latest/tests

Request Parameters

Parameter Description
Api Key Identifies the user. How to get the API Key?
Post Body The parameters you wish to update. See list Below

cURL

curl -X post https://a.blazemeter.com:443/api/latest/tests/ -H "Content-Type: application/json" -H "x-api-key: 65e9f61eb363b2dc1d21" -d '{"projectId":null,"configuration":{"dedicatedIpsEnabled":false,"location":"us-west-1","concurrency":80,"plugins":{"splitCSV":{"enabled":false},"reportEmail":{"enabled":true},"jmeter":{"override":{"duration":25,"rampup":150,"threads":null,"iterations":-1},"version":"2.11blazemeter","filename":"file.jmx"}},"type":"jmeter","serverCount":null},"name":"MyJmeterTest"}'

Example Post Body

{
    "projectId": null,
    "configuration": {
        "dedicatedIpsEnabled": false,
        "location": "us-west-1",
        "concurrency": 100,
        "plugins": {
            "splitCSV": {
                "enabled": false
            },
            "reportEmail": {
                "enabled": true
            },
            "jmeter": {
                "override": {
                    "duration": 25,
                    "rampup": 600,
                    "threads": null,
                    "iterations": -1
                },
                "version": "2.12blazemeter",
                "filename": "file.jmx"
            }
        },
        "type": "jmeter",
        "serverCount": null
    },
    "name": "MyJmeterTest"
}

The Test Object

The Test object contains the following parameters:

Parameter Description Modifiable
name The verbal identifier of the test    ✔
location The Geolocation of the load generators. Download list here.    ✔
rampup The timeframe in which the load will be increased from 0 to the Max concurrent users set    ✔
iterations The number of iterations the test will run until finished. Infinite iteration presented as '-1'    ✔   
concurrency Max number of threads active concurrently per engine    ✔
dedicatedIpsEnabled True will use the Dedicated IPs you've purchased. More info    ✔
.splitCSV.enabled True will split the CSV/s . More info    ✔
reportEmail.enabled True if you like to receive an Email at test's end    ✔
duration The period of time for which the test will run until shut down    ✔
jmeter.version The Jmeter version used to run this test, e.g '2.12 blazemeter'    ✔
type Can be a Jmeter, URL list or Webdriver Test    ✖
created The time the test was started at    ✖
updated The time the test was last updated    ✖
id The unique identifier of the test. The 'Test ID'.    ✖
filename the name of the JMX script uploaded    ✖
userId The unique identifier of the user    ✖
consoleArgs Command line arguments for the console    ✔
engineArgs Command line arguments for the engine/s    ✔

Example Response

{
    "api_version": 4,
    "error": null,
    "result": {
        "id": 5543109,
        "name": "New_Name",
        "draftId": "td_2016_07_14_14_46_37_136992_422",
        "userId": 136992,
        "lastRunTime": 1489410339,
        "created": 1487494074,
        "updated": 1489939765,
        "projectId": 152150,
        "lastUpdatedById": 136992,
        "configuration": {
            "location": "us-east-1",
            "duration": 60,
            "type": "jmeter",
            "concurrency": 50,
            "dedicatedIpsEnabled": false,
            "javaVersion": "1.8",
            "canControlRampup": false,
            "targetThreads": 50,
            "plugins": {
                "remoteControl": [],
                "splitCSV": {
                    "enabled": false
                },
                "reportEmail": {
                    "enabled": false
                },
                "jmeter": {
                    "filename": "Demo.jmx",
                    "version": "3.1",
                    "consoleArgs": "-Jtarget_host=10.7.42.12",
                    "enginesArgs": "-Jtarget_host=10.7.42.12",
                    "override": {
                        "rampup": 300,
                        "iterations": -1,
                        "duration": 60
                    }
                }
            }
        }
    },
    "test": {
        "id": 5543109,
        "name": "New_Name",
        "draftId": "td_2016_07_14_14_46_37_136992_422",
        "userId": 136992,
        "lastRunTime": 1489410339,
        "created": 1487494074,
        "updated": 1489939765,
        "projectId": 152150,
        "lastUpdatedById": 136992,
        "configuration": {
            "location": "us-east-1",
            "duration": 60,
            "type": "jmeter",
            "concurrency": 50,
            "dedicatedIpsEnabled": false,
            "javaVersion": "1.8",
            "canControlRampup": false,
            "targetThreads": 50,
            "plugins": {
                "remoteControl": [],
                "splitCSV": {
                    "enabled": false
                },
                "reportEmail": {
                    "enabled": false
                },
                "jmeter": {
                    "filename": "Demo.jmx",
                    "version": "3.1",
                    "consoleArgs": "-Jtarget_host=10.7.42.12",
                    "enginesArgs": "-Jtarget_host=10.7.42.12",
                    "override": {
                        "rampup": 300,
                        "iterations": -1,
                        "duration": 60
                    }
                }
            }
        }
    }
}
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.