Playwright codegen to page objectsTurn codegen into a test you’d keep.
Paste what npx playwright codegen recorded. Get back plain Playwright: page objects with their locators, a test that calls them, and secrets in environment variables.
Free, no sign-upNever uploadedNo AI, same output every time
Codegen converter
Your codegen
Paste a codegen script
Record a flow with npx playwright codegen <url>, copy the code from the Inspector and paste it here.
Test Runner or Library mode · one test · up to 100 KB
Clean test
Your clean test appears here
Page objects
One class per page, its locators as readonly fields.
A test that uses them
Steps call page methods; checks stay plain
expect().Secrets in the environment
Passwords and card numbers become environment variables.
Plain Playwright
No runtime or helpers. Add it to your project or start a new one.
Page objects and a test that uses them appear here.
Ctrl Enter converts · up to 100 KB
Your script is converted in this tab. It’s never uploaded, logged or stored, and the page sends nothing with it. Analytics count conversions, never their content.
Codegen in, page objects out.
Each page the flow visits becomes a class: its locators as readonly fields, one method per action, and one method for a form and its button. loginPage.signIn(email, password) replaces five codegen lines. Codegen doesn’t record where pages change, so the converter splits at page.goto, links, form buttons and the headings you checked. Rename or merge pages before you download.
From the sample: codegen lines 5 to 9, the LoginPage method they became and the test line that calls it.
Plain Playwright you can drop into your repo.
No Blendra runtime, no helper layer, no config to merge: the page objects import only @playwright/test. Add four files to the project you have, or download a new project with a config, .env.example and a CI workflow.
The two downloads for the sample. The new project needs only @playwright/test and dotenv.
Secrets out of the code, fragile locators flagged.
Passwords, card numbers and tokens never reach the output: the test reads them from environment variables, listed in .env.example. A locator that depends on its position stays as codegen wrote it, with a comment and the fix.
From the sample’s output: the secret the test reads, and the locator a comment asks you to review.
What it doesn't do (yet)
- It can’t see your app: a locator codegen picked by position stays as it is, flagged to review.
- Steps in a second tab stay in the test as recorded; page objects cover the first tab.
- Codegen doesn’t record page changes, so page splits are best guesses you can rename or turn off.
- One test at a time, up to 100 KB.
- Python, Java and .NET codegen aren’t read, and the output is TypeScript only.
Questions
Is the converter free?
Yes. There is no sign-up and no limit on how many scripts you convert. It runs in your browser, so it costs nothing to run.
Does my code leave the browser?
No. The script is converted in this tab. It is never uploaded, logged or stored, and the page sends nothing with it. Close the tab and it is gone.
Which codegen output does it read?
The JavaScript and TypeScript output of npx playwright codegen, in Test Runner or Library mode, from Playwright 1.30 or later, one test at a time. A popup or a download recorded before Playwright 1.32 is listed in Changes but not converted. Python, Java and .NET output aren’t read.
What do I get?
Plain Playwright TypeScript: one page object class per page with its locators as readonly fields, and a test that calls them. There is no Blendra code or runtime in it, so it runs wherever Playwright runs. Add the files to your project, or download a new project with a config, .env.example and a CI workflow.
What does it change?
It removes recording noise (the click before every fill, Tab presses, browser boilerplate), turns a form’s fields and its button into one method, moves passwords and card numbers to environment variables and opens pages relative to your baseURL. Locators and checks stay exactly as codegen wrote them.
Will the test pass as it is?
It should: it runs the same steps with the same locators and checks. Set the secrets first and run it once. If the codegen script was flaky, the converted test is too: the converter can’t fix timing. Two codegen habits to know: a menu that opens on hover replays only if you add a hover() before the click, because codegen doesn’t record hovering; and a check right after a filter click can run before the list updates.
Can it make my locators more resilient?
It can’t see your app. It flags locators that depend on position or generated ids and says how to fix them. The Blendra recorder sees the page, so it saves fallbacks for every element.
Can I convert Cypress or Selenium tests?
Not yet. The converter reads Playwright codegen only.
How is this different from Blendra?
This page cleans up a script you already have. Blendra records the flow in Chrome, saves fallback locators and checks from what each page showed, and keeps the tests in your repo current with npx blendra pull.
Record the next one with Blendra.
Free plan, no credit card. Try Pro free for 7 days.Free plan, no credit card. Sign up now, record later in desktop Chrome.