REST Testing

SoapUI makes it easy to build and run REST requests with dynamic properties and environments.

Request setup

text
1. Create a REST Resource: right-click project → New REST Resource → /users/{id}
2. Add parameters: click Parameters tab
   - Path param: id = 1
   - Query param: format = json
3. Add headers: Authorization: Bearer ${AUTH_TOKEN}
4. Set body (for POST): click Body tab → select JSON
   {"name": "Alice", "email": "[email protected]"}
5. Click Send

Environments / endpoints

text
Right-click project → Project Environments → Add Environment
Name: Staging
Base URL: https://staging.myqatools.com/api

Switch environment via dropdown (top right)
Use property expansion: ${#Environment#BASE_URL}

Property expansion

text
// Reference test suite properties
${#TestSuite#username}

// Reference test case properties
${#TestCase#user_id}

// Reference global properties
${#Global#api_key}

// Reference previous step response
${#Steps#LoginStep#Response#$..token}