Qodex.ai home page
Qodex.ai
Search...
⌘K
Dashboard
Dashboard
Search...
Navigation
How To Use Agents
Test Rules Writing Agent
Demo Call with CEO
Blog
Discord
Get Started
Introducing Qodex.ai
Get Started in 10 Minutes
Test Organization & Monitoring
AI Agent Testing
Testing AI Agents
API Discovery
Upload a Swagger or Postman Collection
Auto-discovering APIs with Qodex SDK
Selecting an Existing Collection
API Testing
How To Use Agents
API Discovery Agent
Test Scenario Creation Agent
Request Data Generation Agent
Test Rules Writing Agent
Auto-Healing Agent
Security Test Agent
Test Scenarios
Create Test Scenarios Manually
API Security
OWASP Top 10 Tests
Real-World Security Vulnerabilities
Penetration Tests
Run Tests & GitHub Sync
Run Tests
GitHub Sync
On this page
How It Works
How To Use Agents
Test Rules Writing Agent
The
Test Rules Writing Agent
helps you define what success looks like for your API tests. Whether you’re checking status codes, validating response fields, or querying your database - Qodex lets you do it all with code or AI-assisted suggestions.
How It Works
Go to any Test Scenario
Navigate to any existing scenario, expand a test case in it and scroll down to the
Test Rules
section.
Choose how to write your rule
Suggested Rules (AI-generated):
Qodex recommends rules like “Status code should be 200” or “Response should include user_id.”
Write Your Own:
Use plain JavaScript to define validations
Use our built-in helper functions like current_response_body, current_status_code, etc.
Two Rule Types Supported
Assertion:
Validates the response body, headers, status, etc.
DB Validation:
Run queries (e.g., PostgreSQL) to confirm backend state after an API call.
Request Data Generation Agent
Auto-Healing Agent
Assistant
Responses are generated using AI and may contain mistakes.