- Testsigma REST APIs
Manage Environments
Elements
Test Plans
Upload Files
Get Project Wide Information
Upload & Update Test Data Profile
Fetch Test Results (All Levels)
Trigger Multiple Test Plans
Trigger Test Plans Remotely & Wait Until Completion
Run the Same Test Plan Multiple Times in Parallel
Schedule, Update & Delete a Test Plan Using API
Update Test Case Results Using API
Create and Update Values of Test Data Profile Using REST API
Rerun Test Cases from Run Results using API
Salesforce Metadata Refresh Using API
Manage Test Steps Using API
Trigger Multiple Test Plans Consecutively
This article explains how to trigger multiple test plans consecutively. You might need this to run a mobile test plan after executing a web test plan.
Sample Test Scenario
Let’s create a User using the Admin HR portal that is accessible only via a Desktop Browser and then manage that user on the Mobile HR App.
Let’s assume there are two Test Plans, namely ‘Admin-TP’ and ‘Mobile-TP’, and that both Test Plans contain one Test Suite each - Admin-TS and Mobile-TS, respectively.
| Test Plan Name | Admin-TP | Mobile-TP |
|---|---|---|
| Test Suite Name | Admin-TS | Mobile-TS |
| Test Cases Names | TC1, TC2 | TC3 and TC4 |
When to make API Call to trigger next Test Plan
The API call to trigger the next Test Plan should preferably be in the very last step of the last Test Case in the previous Test Plan. It is advisable to create a new Test Case and add it as the last Test Case in the Test Suite for separation of concern.
In this case, we can create a new Test Case TC-TriggerNext as the last Test Case in Admin-TS Test Suite and add a REST API Step to trigger the next Test Plan.
So, the Test Cases in Admin-TS become TC1, TC2, and TC-TriggerNext.
How to Trigger next Test Plan
Refer to the documentation on triggering a Test Plan using REST API Calls If you would like to pass some data from Admin-TP to the Mobile-TP, you can achieve this using the runtime test data/parameters. For more information on using runtime test data/parameters, refer to the documentation on using runtime test data/parameters.
For example, if there’s a username that you would pass from Admin-TP to Mobile-TP, you can store the username in a runtime variable such as admin_username and include it in the Request Body for the Trigger Test Plan REST API Call.
Here’s a sample Request Body for passing runtime parameters:
{
"executionid": "274",
"runtimeData": {
"data": "$|admin_username|"
}
}Once the Test Plan Mobile-TP is triggered by the REST API Step in TCTrigger, the runtime parameter ‘admin_username’ is also passed to that Test Plan. You can use those parameters in any Test Case within Mobile-TP now.
Learn more about REST APIs, refer to the documentation on understanding REST APIs