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 containing the equivalent data.

## HTTP Method

POST: Creates the test instance in the test set.

## Request

Headers:

Content-Type: application/xml

Cookies:

Version 2020 (or later) | LWSSO_COOKIE_KEY={LwssoCookie};
Versions earlier than 2020 | LWSSO_COOKIE_KEY={LwssoCookie};QCSession={QCSessionCookie};

Request Body:

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

Request Example
Copy code

    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>

## Response

Headers:

One of:

- Content-Type: application/xml
- Content-Type: 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.

Example
Copy code

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

## See Also

Get all test instances by test ID

Tips to improve your search results... LoadRunner Enterprise REST API Reference LRE REST API All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic(Undefined variable: _rscC_Basic_Variables.VersionLabel)