Record a regression suite
Turn a Browser Sync recording into a suite that replays what you did, in order.
In short
Browser Sync records the API calls a site makes while you use it. The recording can become a regression suite. It holds the requests in the order they happened, with values carried from one to the next and checks from what was recorded. It is ready to run after every change.
Before you start
- Who: signed in, with Edit on the project and the browser extension installed.
- Plan: browser sync is part of every plan; the number of sync sessions depends on it (see Plan & usage).
- First: name the site or sites to record. Calls to any other site are not recorded.
Steps
- Open a project, press the arrow beside "New request" and choose "Record a website…". On a project with no requests, press "Import…" and choose "Record a website". The "Sync a website" window opens.
- Record live with the {{brand}} browser extension. Type the site's address under "Website and API origins", press "Start recording", then use the site as a person would: sign in, create something, read it back. No site at hand? Press "Try a sample recording" and go on to step 4.
- Press "Stop & review" to end the recording and read what it caught.
- Press "Create suite from this session".
- Check the name and where it goes, and untick any request you do not want. Open a request's details to see its headers, body, what it keeps and what it checks.
- Press "Create suite". Nothing saves before that.
- Press "Open the suite" and run it.
Result: a suite whose requests sit in the project like any others. It stops at its first failure.
What becomes a variable
- The site's address becomes the base URL of an environment, and each request starts with {{baseUrl}}.
- A value one answer gives and a later request sends - an id, for example - is kept from the first and used by the second as a variable.
- Each request gets checks from what was recorded for it.
Secrets are never recorded
The recording never captures passwords, tokens or other credentials. A recording keeps only the names of credential headers, never their values, and the draft lists each secret the suite needs by name under "Secrets to fill in". Fill them in on the suite's environment - "Open environments" takes you there. The sample's practice sign-in is public, so it is filled in for you.
Good to know
- The recording keeps only calls to the sites you named when you started it. It never records {{brand}}'s own traffic or other tabs.
- The draft lists browser preflight requests, methods that cannot be sent and anything past the size of one suite as left out, each with its reason.
- Your browser replaces query values that could be credentials, and fields that look like secrets in responses, before it sends anything.
- The suite goes into the project the recording was started for; when it has none, a new project or the one you have open.
If something goes wrong
- The suite fails at the sign-in step: fill in the secrets listed under "Secrets to fill in" on its environment.
- A request you made is missing: it went to a site you did not name, or it is listed as left out with its reason.
- The extension is missing: install it from /help/settings/browser-extension.
Related
- /help/api-testing/test-suites
- /help/settings/browser-sync-recording
- /help/api-testing/stream-sessions