Add, update, or remove a group from a test

Description

Adds a group to a test, deletes a group from a test, gets data on group, or updates the data of an existing group in the test.

URL

Copy code
/LoadTest/rest/domains/{domainName}/projects/{projectName}/tests/{ID}/Groups/{group name}

Remarks

PUT: 

  • If the group exists in the test, the group data is updated. If not, a new group is added. The data can be passed as XML containing the equivalent data.

  • Adding and updating group data does not work with JSON.

HTTP method

  • GET: Gets the data on the group.

  • PUT: Adds or updates the group.

  • DELETE: Removes the group from the test.

Request

Headers:

PUT:

Content-Type: application/xml

Cookies:

Version Cookie
2020 or later

LWSSO_COOKIE_KEY={LwssoCookie};

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. See Test entity XML

Request example:

Copy code
PUT http://<LRE_Server>/LoadTest/rest/domains/TEST_DOMAIN/projects/TEST_PROJECT/tests/1/Groups/{group name}
Content-Type: application/xml
Cookie: LWSSO_COOKIE_KEY={LwssoCookie};

<Group xmlns="http://www.hp.com/PC/REST/API">
    <Vusers>30.0</Vusers>
    <Name>group1</Name>
    <Script>
        <ID>2</ID>
    </Script>
    <RTS>…See the RTS entity XML...</RTS>
<!-- Include this section only if the schedule is by group. See tests and test entity XML. -->
    <Scheduler></Scheduler>
</Group>

Response

Headers:

None

Cookies:

None

HTML return code:

One of the HTTP return codes

HTML body:

  • PUT, DELETE: None

  • GET: The data on the group.

Response examples:

Copy code
XML example - GET:
<Group xmlns="http://www.hp.com/PC/REST/API">
    <Name>login_logout</Name>
    <Vusers>10</Vusers>
    <Script>
        <ID>1</ID>
    </Script>
    <RTS>
        <Pacing>
            <NumberOfIterations>1</NumberOfIterations>
            <StartNewIteration Type="immediately"/>
        </Pacing>
        <ThinkTime Type="replay"/>
        <Log Type="standard">
            <LogOptions Type="on error">
                <CacheSize>1</CacheSize>
            </LogOptions>
        </Log>
    </RTS>
</Group>
Copy code
JSON example - GET:
{
    "Name": "generate_transactions",
    "Vusers": 5.0,
    "Script": {
        "ID": 231,
        "ProtocolType": "Web - HTTP/HTML"
    },
    "CommandLine": null,
    "Hosts": [],
    "RTS": {
        "Pacing": {
            "NumberOfIterations": 1,
            "StartNewIteration": {
                "Type": "immediately"
            }
        },
        "ThinkTime": {
            "Type": "replay"
        },
        "Log": {
            "Type": "standard",
            "LogOptions": {
                "Type": "on error",
                "CacheSize": 1
            }
        },
        "Name": null,
        "JavaVM": null,
        "JMeter": null,
        "Selenium": null
    },
    "Scheduler": {
        "Actions": [
            {
                "StartGroup": {
                    "Type": "immediately"
                }
            },
            {
                "Initialize": {
                    "Type": "just before vuser runs"
                }
            },
            {
                "StartVusers": {
                    "Type": "gradually",
                    "Ramp": {
                        "Vusers": 5,
                        "TimeInterval": {
                            "Seconds": 15
                        }
                    }
                }
            },
            {
                "Duration": {
                    "Type": "run for",
                    "TimeInterval": {
                        "Minutes": 2
                    }
                }
            },
            {
                "StopVusers": {
                    "Type": "simultaneously"
                }
            }
        ]
    },
    "GlobalCommandLine": null,
    "GlobalRTS": null
}

See also: