Skip to content
You're viewing the v2 docs. Looking for v1?Go to v1 docs
Docs
Testsigma
Popular questions
↑↓ to navigate↵ to selectesc to close
Book a demo

Create a test step

POST/test_steps
Base URL https://app.testsigma.com/api/v2Region

Create a single test step in a test case, with its action, element, NLP template, and position after a previous step.

Authenticate with your API key as a Bearer token in the Authorization header. How to authenticate →
testCaseIdThe ID of the test case where you want to add the new step.
templateIdIdentifier for the type of action performed. Mandatory for NLP_TEXT steps (set stepGroupId to null).
previousStepIdThe ID of the step that the new step should follow.
elementIdThe ID of the element associated with this step (required for templates with ${ui-identifier} in grammar).
textThe value of the step's action, e.g. the URL to navigate to.
typeStep type: NLP_TEXT (Natural Language Processing text step) or STEP_GROUP (a group of steps executed together).
idUnique numerical identifier for the newly created test step.
actionHuman-readable description of the action the step performs.
typeStep type: NLP_TEXT or STEP_GROUP.
conditionTypeCondition applied to the step, if any.
testCaseIdParent test case ID.
stepGroupIdStep group ID for STEP_GROUP steps; null for NLP_TEXT steps.
Request
curl -X POST \
  'https://app.testsigma.com/api/v2/test_steps' \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "testCaseId": 9,
    "templateId": 1044,
    "previousStepId": 223,
    "elementId": 567,
    "text": "https://www.google.com",
    "type": "NLP_TEXT"
  }'
const response = await fetch('https://app.testsigma.com/api/v2/test_steps', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "testCaseId": 9,
      "templateId": 1044,
      "previousStepId": 223,
      "elementId": 567,
      "text": "https://www.google.com",
      "type": "NLP_TEXT"
  })
});
const data = await response.json();
import requests

response = requests.post(
  'https://app.testsigma.com/api/v2/test_steps',
  headers={
    'Authorization': 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  },
  json={
      "testCaseId": 9,
      "templateId": 1044,
      "previousStepId": 223,
      "elementId": 567,
      "text": "https://www.google.com",
      "type": "NLP_TEXT"
  }
)
data = response.json()
Response200 OK
{
  "id": 5846,
  "action": "Navigate to https://www.google.com",
  "type": "NLP_TEXT",
  "conditionType": null,
  "testCaseId": 9,
  "stepGroupId": null
}

Was this page helpful?