Open topic with navigation

# tests/{ID}

## Description

Returns, deletes, or updates a test design by the specified test ID.

## URL

    /LoadTest/rest/domains/{domainName}/projects/{projectName}/tests/{ID}

## Remarks

When updating the test data, the request body contains only the data to be changed. The request body is a subset of test entity XML.

The test data can be passed as XML containing the equivalent data.

## HTTP Method

GET: Returns the design test.

PUT: Updates the design test.

DELETE: Deletes the test.

## 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:

GET: No request body.

DELETE: No request body.

PUT: An XML describing the data to be updated in the test. In addition to the updated element, the following elements must always appear: `<WorkloadType>`, `<LGDistribution>`, `<Groups>` and `<Scheduler>`. See test entity XML.

Request Example - GET

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

Request Example - PUT request which updates the test

    PUT http://<LRE_Server>/LoadTest/rest/domains/TEST_DOMAIN/projects/TEST_PROJECT/tests/1
    Content-Type: application/xml
    Body:
    <Content xmlns="http://www.hp.com/PC/REST/API">
    <WorkloadType>
       <Type>Basic</Type>
       <SubType>by test</SubType>
       <VusersDistributionMode>by number</VusersDistributionMode>
    </WorkloadType>
    <LGDistribution>
       <Type>all to each group</Type>
       <Amount>1</Amount>
    </LGDistribution>
    <Groups>
       <Group>
           <Name>auto_group</Name>
           <Vusers>23</Vusers>
           <Script>
               <ID>4</ID>
           </Script>
       </Group>
    </Groups>
    <Scheduler>
    <Actions>
       <Action>
          <Initialize Type="just before vuser runs">
          <Vusers>0.0</Vusers>
          </Initialize Type>
       </Action>
       <Action>
           <StartVusers Type="gradually">
           <Ramp>
               <TimeInterval>
                   <Days>0</Days>
                   <Hours>0</Hours>
                   <Minutes>0</Minutes>
                   <Seconds>50</Seconds>
               </TimeInterval>
            </Ramp>
            <StartVusers Type>
       </Action>
       <Action>
           <Duration Type="run for">
           <TimeInterval>
               <Days>0</Days>
               <Hours>0</Hours
               <Minutes>2</Minutes>
               <Seconds>0</Seconds>
           </TimeInterval>
           </Duration>
       </Action>
       <Action>
           <StopVusers Type="simultaneously">
           </StopVusers>
       </Action>
    </Actions>
    </Scheduler>
    </Content>

## 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:

GET and PUT: Returns the data on the entity in the test entity XML or equivalent JSON string. If method is PUT, returns the data after the update. See test creation XML.

DELETE: No body returned.

## See Also

tests
test entity XML
test creation XML