AI Record Agent: Record a Journey, get a Real Test in your Framework

Record a Journey through your web app or tap through your mobile app, and the AI writes a real test in your framework, using your page objects, then runs it until it passes. Assertions, custom steps, passwords, merging and history, all covered.

T
The Testver team · 15 min read

You already know the flow: sign in, search for a product, add it to the cart, check out. Clicking through it takes a minute. Writing it as a test, with the right locators, waits, page objects and checks, can take an hour.

AI Record Agent closes that gap. You click through your web app, or tap through your mobile app, exactly as a user would. Testver captures every step, and then the AI writes a real test file in your framework, in your language, using your page objects and helpers. Then it runs the test and fixes it until it passes.

This post covers everything AI Record does: recording on the web and on phones, assertions and notes, keeping passwords out of the code, custom steps for the parts that aren't clicks, generating and merging tests, and Recording History.

Not your usual recorder

Classic record-and-playback tools save what you clicked as a script of their own, often with brittle selectors, and that script rarely looks like the rest of your suite. AI Record works differently:

  • The recording is input, not output. Your steps, with their screenshots, locators and page structure, are what the AI works from. The output is ordinary code in your repository.

  • It writes like your team. The AI reads your project first: sample tests, page objects, helpers and dependencies. It works out the framework and language on its own, so there is no framework dropdown to fill in.

  • It proves the test. After writing it, the AI runs the test and fixes failures before it calls the job done.

  • The test stays yours. It's a plain file in your project. It shows up in Test Explorer, runs from the Runner and CI, and keeps working even if you stop using Testver.

The generated code can be Playwright (TypeScript, JavaScript, Python, Java or .NET), Cypress, Selenium (with TestNG, JUnit, pytest or NUnit), WebdriverIO, Puppeteer or Cucumber on the web, and Appium on mobile.

One screen for web and mobile

Open Agents → AI Record. The screen opens in the mode that matches your workspace: a web workspace lands on the Web recorder, a mobile workspace on the Mobile recorder. If your workspace has both, a Web | Mobile toggle in the header switches between them.

The recorder sits on the left: the step timeline, the controls and, later, the generation panel. The live browser or device sits on the right. Drag the divider between them to give either side more room.

Recording a web flow

  1. Type a Starting URL, such as http://localhost:3000 or your staging site.

  2. Check the status line. A green dot means a browser is already running and the recording reuses it; grey means a new one is launched.

  3. Click Start Recording. A real Chromium browser opens, and the live view appears beside the recorder.

Now just use your app. You can click in the live view or in the real browser window. The live view is a full browser, not a picture of one:

  • Tabs and a URL bar with back, forward and reload.

  • Viewport presets: Mobile (375×812), Tablet (768×1024), Desktop (1280×720) and Full HD (1920×1080).

  • Element highlight, which shows the tag, id and class of the element under your cursor.

  • A DevTools panel with Network and Console.

  • Picture-in-Picture, which pops the browser into a floating window.

What gets captured

Every interaction becomes a numbered step with an icon, a plain-English description and, for clicks, a screenshot thumbnail:

You do

The step reads

Click or double-click

Click 'Sign in' button

Type into a field

Enter 'user@test.com' into Email

Pick from a dropdown

Select 'United States'

Tick a checkbox

Check 'Remember me'

Hover a menu

Hover over Account menu

Choose a file

Upload 'avatar.png'

Drag and drop

Drag 'Card 3' onto 'Done'

Answer a browser dialog

Accept confirm 'Delete this item?'

Press a key that matters

Press Enter

Keys are recorded when they matter: Enter, Escape, Tab, arrows in menus and lists, Backspace, function keys and shortcuts such as Control+S. Steps inside iframes (nested ones too), shadow DOM components and new tabs are recorded with where they happened, and the generated code switches into that frame, component or tab.

Recording a mobile flow

Switch to Mobile, then pick:

  • a Provider: a phone or emulator connected to your computer, or a device cloud such as BrowserStack, LambdaTest or Sauce Labs;

  • a Device from the searchable list;

  • an App from your app library, or Upload a new .apk or .ipa. It's the same library the AI Assistant and the Runner use, so you upload a build once.

Click Start Recording and the device mirror appears. Then you can work two ways:

  • Tap the mirror in Testver, and type or send hardware keys (Enter, Back, Home, volume, power) from the box under the timeline.

  • Pick up the phone, or use the emulator directly, and tap through your app by hand. Testver records those taps too, each with a thumbnail of the element. For long flows and gestures this is often the most natural way to record.

Native, web and hybrid apps

You don't configure anything for the kind of app. Testver records native elements by resource id, accessibility id, text or XPath, and web pages in a mobile browser with web locators. In a hybrid app, such as React Native, Ionic or Cordova, or a native app with an embedded checkout page, it detects the webview and records CSS locators for the web content inside it. A WEBVIEW chip in the device bar shows you when that's happening, and the generated test includes the context switch, so it drives the webview correctly when it runs.

Playback before you generate

On mobile, stop the recording and click Playback to replay your steps on the device. It's a quick way to confirm the steps are solid before you spend an AI generation on them.

Cloud devices are billed by the minute, so Testver closes an unattended cloud session for you: after 10 minutes with no actions (with a 90-second warning and a Keep session open button), or after 3 hours. Phones and emulators on your own computer have no such limits.

Mobile testing in Testver is in beta.

Turn clicks into a real test: Assert, Annotate, Pause

A recording that only clicks proves very little. Three controls in the header make it a test.

Assert

Click the shield button. It turns green and shows ON. Now click the element you want to verify: it isn't clicked for real. On the web you can also move between elements with the arrow keys (↑ to the element around it, ↓ to the first one inside it, ← and → to its neighbours) and press Enter. A list of checks opens for that element, for example:

  • is visible, or is not visible;

  • contains the text, or has the value;

  • has an attribute or a placeholder;

  • is enabled, disabled or checked;

  • the page title contains;

  • the element count.

Pick one and it's recorded as an assert step.

Annotate

Some checks are too rich for a list. Click the scan button (it turns purple), select an element, or the larger area around it with ↑, and describe what you want in plain words: "the total must equal the sum of the rows", or "sort by price and check the first item is the cheapest". The note becomes a step, and the AI writes the code for it at exactly that point.

Pause

Pause lets you click around without recording, so you can close a cookie banner, set up some state or find your way back. The timer stands still while you're paused. On mobile, Pause also stops recording taps you make on the phone itself.

Passwords never end up in the test

When you type into a password field, in the browser or in the app, the step shows ••••••••. The value stays on your machine, in the git-ignored file .testver/recorded-secrets.json, under a variable name such as TEST_PASSWORD. A second account's password becomes TEST_PASSWORD_2.

  • The generated test reads the variable (process.env.TEST_PASSWORD, os.environ["TEST_PASSWORD"] and so on) instead of containing the password.

  • When Testver runs the test, during generation or from the Runner, it sets the variable for you. A value you set yourself always wins.

  • On CI or another machine, set the variable there.

Edit the recording before you generate

Nobody records a perfect flow on the first try, so every step stays editable:

  • Remove a step you didn't mean to record.

  • Re-inspect Element re-picks a step's element on the live page. It refreshes the locators, the description and the page structure the AI works from.

  • Reorder steps by dragging once the recording is stopped, or from the keyboard with Alt+↑ and Alt+↓.

  • Add More Steps resumes the same recording to capture more, and keeps the edits you made.

  • Click a thumbnail to see the full screenshot with the target element highlighted.

  • On mobile, tap a step to rename its description.

Custom steps: the parts that aren't clicks

Real tests do more than click. They log in with the helper your project already has, read a reset email, create data through an API, or wait for a background job. A custom step describes such a part in plain words, and the AI writes the code for it at that position. Add one while recording from the header, or after stopping by hovering between two steps and clicking + Custom step.

Quick picks give you a starting sentence:

Quick pick

Use it for

Example

Use existing step

Reusing a page object, helper or test

Log in as Admin using @LoginPage.loginAs

Test data

Reading values from a data file

Read the user from @data/users.csv

Email / code

Reading an email or a verification code

Read the latest email with subject containing "Reset password" and keep the link in it

API / setup

Preparing data without the UI

Create an order through the API and keep its id

Wait for

Something that takes time

Wait until the order status shows "Shipped" (up to 60 s)

Custom

Anything else

Clear the app's cache

Point at your own code with @

Type @ in a custom step to search your project: page-object methods, helpers, BDD steps, existing tests and test-data files. Pick one, and a chip shows exactly what it points to, such as loginAs(page, role) with its file and line. The AI then opens that file and calls your code instead of writing the steps again.

Pass values between steps

A one-time link or code can't be recorded ahead of time. So a custom step can save values, such as resetLink or otpCode, and a later recorded step can use one. Hover a typing, select or navigate step, click { } and pick the value. The step then shows uses {resetLink}, and the generated test passes the value along instead of hard-coding what you typed.

Replace recorded clicks with one helper

Recorded five clicks through a login form that your project already does with one helper? Select those steps and click Replace with custom step. The replaced steps stay attached as reference, so the AI knows what the step must achieve, and one click puts them back if you change your mind.

Test data and setup

  • Test data → Read the data from a file picks a CSV, JSON or Excel file from your project. Use the data for N recorded values swaps what you typed for the matching columns. Run the test once per row makes the test data-driven, in your framework's own style. Only the file name and its columns go to the AI, never the values, and columns that look sensitive are hidden.

  • Before the test describes what must be true before step one, such as "Start logged in as a Manager using @loginAs". The AI puts it where your project keeps setup: a hook, a fixture or a Background.

Example: a password reset test

Password resets are hard to record, because the link only exists in an email. With custom steps the test takes about a minute to record:

  1. Record: open the login page, click Forgot password, type the email address and click Send link.

  2. Add a custom step with the Email / code quick pick: subject contains "Reset password", keep the link. It saves emailLink.

  3. Record: navigate to the reset link from your test inbox, type the new password twice and click Save.

  4. Click { } on the navigate step and pick emailLink, so the test opens the fresh link each time.

  5. Assert that "Password updated" is visible, then generate.

The test reads the newest email on every run, follows its link, and gets the password from an environment variable, not from the code.

Generating the test

Stop the recording and the generation panel appears. Choose where the test goes:

  • New Test: give it a name, which becomes the test's title in plain words.

  • Add to Existing Test: pick the target test and either Guide AI on where the steps go (type @ to point at an existing step, such as "insert after @[Given I am on the homepage]") or Append At End. The test keeps its name, imports and style, and new locators go into the page object it already uses.

Pick the AI model (Testver cloud AI, or a model you added to a local provider), then click Generate Test Code. Generation happens in two stages:

  1. Plan first. The AI reads your project and your recording and explains its plan in the timeline. That covers which helpers it will reuse, how it will handle each custom step, the test data and the setup. Nothing is written yet. The header says Waiting for your input.

  2. You approve. Press Enter to go ahead, or type feedback to change the approach. Redirecting here is much cheaper than fixing code later.

  3. Write, run, fix. The AI writes the test, runs it and fixes failures, with its work grouped into readable rows, such as Read 4 files, created login.spec.ts, ran the tests. Click a row to see each call and its diffs. If it wants to do something sensitive, a permission card asks you first.

When it's done, a Changed N files card lists every file it created or changed. Review opens the diffs file by file, and Open in Git takes you to the Git screen to commit them. Want a change? Type it in the chat bar ("add a check for the total", "rename the test"), and the AI keeps the context of the generation.

Built to survive UI changes

Every locator in a recorded test comes with a one-line description of its element (// "Save" button), and the alternative locators the recorder ranked are saved next to it. When the UI changes later and a locator breaks, Auto-Heal uses those saved alternatives as free, high-quality evidence for the fix, and re-runs the test to prove it. Recording with Testver is the cheapest way to make a test easy to heal.

Recording History

Every recording is kept in Recording History (the clock button): the steps, the AI conversation and the diffs, with a badge for how it ended (Generated, Failed, Stopped or Recorded).

  • Group by Today, Yesterday, This Week and Earlier, search by name or URL, and add tags such as smoke, checkout or your own.

  • Reopen a recording to read it, or to edit and generate one you hadn't generated yet.

  • On a shared server, everyone sees only their own recordings.

And nothing is lost along the way. A page reload picks the recording up where it was. Leaving the screen and coming back keeps everything, even a generation that was running. Closing the tab saves the recording to History. A draft is saved every 10 seconds, so after a server restart an Unsaved Draft Found banner brings it back.

Tips for better recordings

  • One journey per test. "Sign in and add a product to the cart" is a good test; "the whole site" is not.

  • Start from a known state: a starting URL on web, a fresh app launch on mobile.

  • End with an assertion on the outcome that matters, such as a success message or a cart total.

  • Reuse, don't re-record. If your project already logs in or seeds data with a helper, point at it with a custom step and @.

  • Use Pause for setup, so only meaningful steps are captured.

  • Read the plan before you approve it.

  • Name and tag recordings so History stays easy to search.

Common questions

Do I need to know Playwright, Selenium or Appium? No. You record; the AI writes the code in whatever your project uses. It does help to read the plan and the result before you commit.

Where does the generated test go? Into your project as a real file, listed on the Changed files card. It appears in Test Explorer and runs from the Runner like any other test.

Can I add the steps to a test I already have? Yes. Choose Add to Existing Test and tell the AI where they go.

How long can a recording be? As long as you need. The first 150 steps go to the AI, and the summary tells you if there were more.

Does it work with a local AI model? Yes. Pick any model you added to Ollama or LM Studio. Testver cloud AI gives better results on long flows.

Can I record through the Local Browser Connector? Not yet. Testver tells you so when you start, so start the recording in the browser Testver opens.

Watch it

Try it

Open Agents → AI Record, type your app's address and click Start Recording. Record one journey, add an assertion, and click Generate Test Code. The full guide is at docs.testver.com/tools/ai-record.

New to Testver? Run testver serve in your test project and follow the installation guide, or read web automation testing with AI to see where AI Record fits in the whole workflow.

#AI Testing#Web Automation#AI Record#Mobile App Automation#AI Test Engineer#Test Automation

Keep reading

Put these ideas to work

Turn your framework into an AI-powered testing platform

Self-hosted, on the stack you already use. Free to start.