Rayrun
← Back to Discord Forum

Browser not opening in Code Gen VS Code

killerDeuceposted in #help-playwright
Open in Discord
killerDeuce

I am trying Code Gen for first time in VS Code. When I click Record New I get promoted to install browsers. I select Chromium. Then nothing happens.. as I understood it a browser window should have opened? Any help appreciated.. thanks

This thread is trying to answer question "Why doesn't a browser window open when the user selects Chromium after clicking 'Record New' in Code Gen on VS Code?"

1 reply
_kalkleiste_

do you use the plugin or do you run the command via cli like npx playwright codegen <http://url_of_my_webpage> ?

Answer

Troubleshooting Chromium in CodeGen on VS Code

If Chromium doesn't open after clicking "Record new" in CodeGen on VS Code, there could be a few reasons why.

Check Playwright Extension

First, make sure the Playwright extension is installed and enabled in VS Code. You can check this by going to the Extensions view (Ctrl+Shift+X) and searching for "Playwright". If it's not installed, click "Install". Once installed, ensure it's enabled by checking for a green checkmark next to its name.

Set Default Profile

Next, ensure Chromium is your default profile for debugging tests. Right-click on the debug icon in the testing sidebar and click "Select Default Profile". Choose "Chromium" from the options.

Update Playwright

Lastly, make sure you have the latest version of Playwright installed globally on your machine. Run the following command in your terminal:

npm install -g playwright

Also, ensure all necessary dependencies are properly installed according to Playwright's documentation.

If you're still having issues, consult Playwright's official documentation or their community forums for further troubleshooting. For more information on @playwright/test, check out this comprehensive guide.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].