NLP Web & API Testing
Write browser and REST tests in plain English. This guide covers Steps (what runs), Objective goals (Generate steps), and data-driven CSV/JSON loops — the same contracts as the in-app Playground.
One rule: Run always executes Steps — never the Objective text alone. Write Steps directly, or write a goal → Generate steps → review Steps → Run.
Objective vs Steps
| Layer | What it is | Who edits it |
|---|---|---|
| Objective | Human goal / intent. Optional authoring layer. | You write a goal, then click Generate steps. |
| Steps (NLP) | Executable lines the runner understands. | You, or Generate steps. This is what Run uses. |
| Run | Playwright / API executor. | Expands data loops, then runs each NLP line. |
In Test Manager you will see Objective and Steps tabs. In Playground, Show goal builds an Objective you can paste; the card NLP is the Steps script.
Web UI NLP (normal Steps)
Browser flows use Navigate, Wait, Click, Fill, Verify, and table helpers.
Navigate to https://www.saucedemo.com
Fill Username with "standard_user"
Fill Password with "secret_sauce"
Click on Login
Wait for 2 seconds
Verify page contains "Products"
Useful Web patterns
Verify page contains "text"— page-wide text (pipe|= any match).Verify table contains "Department"— table header/cell.Verify columns for First Name, Last Name, and Email are visibleVerify table has at least 3 rowsVerify row where Email is cierra@example.com contains Insurance— row-scoped assert.
After Navigate on React sites (e.g. DemoQA), keep a short Wait for 3 seconds (or wait for the table) before verifies.
API NLP (normal Steps)
REST calls never use browser Navigate to an API host. Use Call API / POST / Verify response.
Call API GET https://fakestoreapi.com/products/1
Verify API response status equals 200
Verify response.id is a number
Verify response.title is a string
POST to https://fakestoreapi.com/products with body {"title": "TestNeo", "price": 9.99, "description": "demo", "category": "electronics", "image": "https://fakestoreapi.com/img/71.jpg"}
Verify API response status equals 201
Verify response.title equals "TestNeo"
Chaining with {{variables}}
Double braces are stored / env variables (not CSV row columns).
Call API GET https://fakestoreapi.com/users/1
Verify API response status equals 200
Store response.id as userId
Call API GET https://fakestoreapi.com/carts/user/{{userId}}
Verify API response status equals 200
Objective goals in detail
Goals are for authoring. Generate steps turns them into NLP. Simple flows use a short Confirm + checklist. Data-driven flows must embed the full loop script.
Simple Web goal
Confirm login at https://www.saucedemo.com:
Fill username/password, click login, land on products.
- page contains "Products"
Generate steps should produce Navigate + Fill + Click + Verify (and usually a Wait).
Simple API goal
Use (API): in the header — not at https://api… (that can plan a browser Navigate).
Confirm GET product (API):
Fetch one product and check types.
- Call API GET https://fakestoreapi.com/products/1
- Verify API response status equals 200
- Verify response.id is a number
- Verify response.title is a string
Data-driven goal (must include the loop)
Soft bullets alone (- POST … {title}) cannot drive a CSV loop.
Playground Show goal for data-driven cards embeds the full script and marks [data-driven].
Confirm CSV loop — POST multiple products (API) [data-driven]:
Each CSV row creates a product via FakeStore.
Data:
title,price,description,category
TestNeo Laptop,999.99,Created via CSV POST loop,electronics
TestNeo Watch,149.50,Smart watch from data row,jewelery
End Data:
For each row:
POST to https://fakestoreapi.com/products with body {"title": "{title}", "price": {price}, "description": "{description}", "category": "{category}", "image": "https://fakestoreapi.com/img/71.jpg"}
Verify API response status equals 201
Verify response.title equals "{title}"
Verify response.category equals "{category}"
End For
After Generate steps, Steps should still show Data: … For each row: … End For — not only the four POST/Verify lines.
Data-driven loops
| Pattern | Playground | Test Manager |
|---|---|---|
Data: … End Data: + For each row: |
Yes (inline) | Yes |
JSON array inside Data: |
Yes | Yes |
Use data from "file.csv" |
No upload | Yes — upload in Test Data first |
with body from file "payload.json" |
No upload | Yes — Test Data tab |
Row columns use single braces: {productId}, {title}.
Env / Store vars use double braces: {{base_url}}, {{authToken}}.
In JSON bodies, quote strings ("{title}") but not numbers ({price}).
Use data from (goal that works)
Confirm Use data from CSV (API) [data-driven]:
Upload post-products-valid.csv in Test Data, then run.
Use data from "post-products-valid.csv"
For each row:
Call API GET {{base_url}}/resource/{name}
Verify API response status equals 200
Verify response.description equals "{description}"
End For
Playground sample card: Use data from — project CSV file (Test Manager)
(demo file fakestore-products.csv).
Copy-paste recipes
1) Web — SauceDemo login (Steps)
Navigate to https://www.saucedemo.com
Fill Username with "standard_user"
Fill Password with "secret_sauce"
Click on Login
Wait for 2 seconds
Verify page contains "Products"
2) API — FakeStore GET (Steps)
Call API GET https://fakestoreapi.com/products?limit=5
Verify API response status equals 200
Verify response is an array
3) API — CSV GET by category (Steps or full Objective)
Data:
categoryName
electronics
jewelery
End Data:
For each row:
Call API GET https://fakestoreapi.com/products/category/{categoryName}
Verify API response status equals 200
End For
4) API — JSON array in Data block
Data:
[{"productId": 5, "expectedCategory": "jewelery"}, {"productId": 9, "expectedCategory": "electronics"}]
End Data:
For each row:
Call API GET https://fakestoreapi.com/products/{productId}
Verify API response status equals 200
Verify response.category equals "{expectedCategory}"
End For
Don’t do this
Broken data-driven Objective — placeholders without a Data / Use data from block.
Generate steps will reject this (or produce a single POST with literal {title} on older builds).
Confirm CSV POST (API):
- POST to https://fakestoreapi.com/products with body {"title": "{title}", "price": {price}, ...}
- Verify API response status equals 201
- Do not
Navigate to https://fakestoreapi.com/...for REST tests. - Do not Run expecting the Objective checklist to execute without Generate / Steps.
- Do not put executable
Code:blocks in Objective goals (use Steps). - Column verifies: prefer
Verify columns for A, B, and C are visible— avoid trailing wordcolumnson the last header (e.g.Department columns).
Where to try it
- Playground — filter api, data-driven, or nlp-reference; use Show goal then paste into Test Manager.
- Test Manager — Objective → Generate steps → Steps → Run. Upload CSVs under Test Data for
Use data from. - CLI / VS Code — same NLP Steps format in
.testneofiles (Steps-first; no Objective tab).
Related: CLI · VS Code · Playwright AI SDK · All docs