Skip to content

Record start url support#756

Open
thombrink wants to merge 1 commit intomicrosoft:mainfrom
thombrink:feature/record-start-url
Open

Record start url support#756
thombrink wants to merge 1 commit intomicrosoft:mainfrom
thombrink:feature/record-start-url

Conversation

@thombrink
Copy link

Summary

  • Adds a playwright.recordStartUrl VS Code setting that configures a URL to navigate to when using "Record new"
  • When set, the generated test template includes await page.goto(url) which navigates the browser before recording starts
  • Includes URL scheme validation (http://, https://, file://, etc.) with a localized error message
  • When empty (default), behavior is unchanged — recording starts on about:blank

Motivation
Currently, clicking "Record new" opens the browser at about:blank and the user must manually navigate to their application. The CLI equivalent (playwright codegen ) supports a URL argument, but the VS Code extension had no equivalent. This setting closes that gap.

How it works
The URL is embedded as page.goto() in the generated test template. The test runs before recording starts, navigating the browser in-place — no subprocess or CDP manipulation needed.

@thombrink
Copy link
Author

@microsoft-github-policy-service agree

@thombrink
Copy link
Author

It also fixes issue 20059

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant