Click the element you require and it will now show up in the Pick locator box in VS Code.Click on the Pick locator button form the testing sidebar and then hover over elements in the browser window to see the locator highlighted underneath each element.You can generate locators with the test generator. In the test file in VS Code you will see your new generated actions added to your test at the cursor position. In the browser window start performing the actions you want to record. If your browser window is not already open then first run the test with 'Show browser' checked and then click the Record at cursor button. To record from a specific point in your test move your cursor to where you want to record more actions and then click the Record at cursor button from the Testing sidebar. You can then inspect your file and see your generated test and then manually improve the test by adding assertions. Once you are done recording click the cancel button or close the browser window.
Playwright will record your actions and generate the test code directly in VS Code. In the browser go to the URL you wish to test and start clicking around to record your user actions. This will create a file as well as open up a browser window. To record a test click on the Record new button from the Testing sidebar.