Share this page

# Create new instance in test set

Available in versions: 12.56 and later

## Description

Adds a test instance to a test set based on the specified test.

## URL

Copy code

    /LoadTest/rest/domains/{domainName}/projects/{projectName}/testInstances

## Remarks

The data can be passed as XML or JSON containing the equivalent data.

## HTTP method

POST: Creates the test instance in the test set.

## Request

Headers:

One of the following:

- Content-Type: application/xml

- Content-Type: application/json

Cookies:

Version | Cookie
--- | ---
2020 or later | LWSSO_COOKIE_KEY={LwssoCookie};
Earlier than 2020 | LWSSO_COOKIE_KEY={LwssoCookie};QCSession={QCSessionCookie};

Request body:

XML or JSON containing the test ID and the ID of test set in which to create the test instance.

Request examples:

Copy code
XML example:

    POST http://<LRE_Server>/LoadTest/rest/domains/TEST_DOMAIN/projects/TEST_PROJECT/testInstances
    Content-Type: application/xml
    Cookie: LWSSO_COOKIE_KEY={LwssoCookie};

    <TestInstance xmlns="http://www.hp.com/PC/REST/API">
       <TestID>6</TestID>
       <TestSetID>1</TestSetID>
    </TestInstance>

Copy code
JSON example:

    POST http://<LRE_Server>/LoadTest/rest/domains/TEST_DOMAIN/projects/TEST_PROJECT/testInstances
    Content-Type: application/json
    Cookie: LWSSO_COOKIE_KEY={LwssoCookie};

    {    "TestID": 178,
         "TestSetID": 102
    }

## Response

Headers:

One of:

- Accept: application/xml

- Accept: application/json

Cookies:

None

HTML return code:

One of the HTTP return codes

HTML body:

The test ID, the test set ID, and the ID of the new test instance.

Response examples:

Copy code
XML example:

    <TestInstance xmlns="http://www.hp.com/PC/REST/API">
        <TestID>6</TestID>
        <TestSetID>1</TestSetID>
        <TestInstanceID>1</TestInstanceID>
    </TestInstance>

Copy code
JSON example:

    {    "TestInstanceID": 14,
         "TestID": 178,
         "TestSetID": 100
    }

See also:

- Get all test instances by test ID

Tips to improve your search results... OpenText™ Enterprise Performance Engineering API Reference OpenText™ Enterprise Performance Engineering All View Local Help Center View Online Help Center(Undefined variable: _rscC_Basic_Variables.VersionLabel)