Does Playwright have the ability to 'record' tests, and if so, what is the quality of these recorded tests?

Allan Ravn posed a question about Playwright in our Ask Me Anything with @utchbe :

“Does Playwright have the capability to ‘record’ tests, and how good are these recorded tests in terms of quality?”

Any thoughts or experiences with Playwright’s recording feature would be useful.

3 Likes

I know that there is a record and playback option, but as to the quality of those tests I’m note sure since I haven’t tried it yet, but I assume it would be similar to Selenium IDE where it can generate the code for your recorded actions, such code would usually need some tweaking, but it can be a good starting point and a potential time saver:
Test generator | Playwright.

3 Likes

It can be good to use to have some prewritten code.
You can consider it like a template.
From there you need to understand, delete, and refactor.
But for most applications, it isn’t as useful as they are generated.
One thing I found useful sometimes was the locator generator. I now use the VSCode extension for that, to ease the search of some locators.

3 Likes