TestFlow Agent: Converting English and Web Traffic to API Tests

Jamie16 Novice 1h ago Updated Jul 27, 2026 299 views 12 likes 2 min read

Writing the same business flow three times—once for Postman, once for Playwright, and once for JMeter—is a massive waste of time. The requests and assertions are identical, but the syntax differs, leading to "test drift" the second a requirement changes. I built TestFlow Agent to solve this by generating all three artifacts from a single source of truth.

Natural Language to API Sequence

If you're testing your own service and already know the endpoints, you can skip the recording phase entirely. You just describe the flow in plain English:

Create an enrollment for a Texas member.
Get available plans for Texas. Select a Silver plan.
Submit enrollment with effective date 01/01/2026.
Validate enrollment status is ACTIVE.

The agent parses the intent and maps it to the actual API sequence:

POST {{baseUrl}}/auth/token
POST {{baseUrl}}/members
GET {{baseUrl}}/plans?state=TX
POST {{baseUrl}}/enrollments
GET {{baseUrl}}/enrollments/{{enrollmentId}}

It then outputs the Postman collection, Playwright spec, and JMeter plan. Since it includes a mock API, you can actually execute the flow end-to-end to verify the logic before deploying it to a real environment.

The Browser Discovery Mode

The more powerful side of this is the discovery mode, which requires zero prior knowledge of the API. You point the tool at a live URL, perform the actions manually in a browser, and it intercepts the network traffic to build the tests.

Turning raw browser logs into a stable AI workflow is harder than it looks because web traffic is noisy. To make these tests actually runnable, I had to implement a few specific logic layers:

  • Dynamic Variable Chaining: It detects IDs and tokens in responses and automatically injects them into subsequent requests.
  • Semantic Naming: It maps variables based on JSON fields (e.g., employee.id becomes employeeId) rather than unreliable URL strings.
  • Token Refresh: Instead of hardcoding stale CSRF tokens that cause 403 errors, it configures the test to fetch a fresh token during the login sequence.
  • Noise Filtering: It strips out analytics, fonts, and tracking pixels so you only see the business-critical API calls.
  • Token Matching: It uses whole-token matching to ensure a short ID (like 7) doesn't accidentally overwrite part of a larger number (like 4700).

This essentially turns a manual walkthrough into a complete guide of API tests without having to manually inspect the Network tab for an hour.

https://github.com/sshankar07/test-flow-agent
AILLMautomationLarge Language Modelplaywright

All Replies (3)

N
Nova28 Advanced 9h ago
Does this handle OAuth2 flows automatically or do you have to pass the tokens manually?
0 Reply
Z
Zoe12 Novice 9h ago
Still doesn't handle dynamic tokens or session state properly. Total nightmare to debug when the AI hallucinations hit.
0 Reply
R
Riley2 Advanced 9h ago
Been using something similar to sync Postman mocks with my CI pipeline, saves a ton of time.
0 Reply

Write a Reply

Markdown supported