question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Getting-started more details for use existing browser needed

See original GitHub issue

Where am i stuck?

On use existing browser channel it says

Playwright’s Firefox version matches the recent Firefox Stable build.

This will likely not work for our company because we use firefox esr (and very often an older version). The section google-chrome or microsoft-edge states

Playwright … can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine

This sounds promising.

  • Could you elaborate where the provided configuration lines (see code below) have to be put?
  • How to proceed from here?
import { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
  use: {
    channel: 'chrome',
  },
};
export default config;

The reading of the following lines is optional and just to give you the full context of my previous steps and the current state of affairs.

What happened before - read is optional

Under windows 10 using node v14.16.0 and npm 6.14.11 on a non-elevated node-js command prompt i entered this command

C:\dev\webtest>npm init playwright@latest play-hello

this was partly succesfull

npx: installed 1 in 2.07s
Getting started with writing end-to-end tests with Playwright:
Initializing project in 'play-hello'
√ Do you want to use TypeScript or JavaScript? · TypeScript
√ Where to put your end-to-end tests? · tests
√ Add a GitHub Actions workflow? (Y/n) · false
Initializing NPM project (npm init -y)…
Wrote to C:\dev\webtest\play-hello\package.json:
....
Installing Playwright Test (npm install --save-dev @playwright/test)…
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN play-hello@1.0.0 No description
npm WARN play-hello@1.0.0 No repository field.

+ @playwright/test@1.20.1
added 190 packages from 184 contributors in 19.739s

But installing browsers / chromium failed

Downloading browsers (npx playwright install)…
Failed to install browsers
Error: Failed to download chromium v978106, caused by
Error: connect ETIMEDOUT 13.107.213.45:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
Error: Command failed: npx playwright install
    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at executeCommands 
        (C:\Users\...\AppData\Roaming\npm-cache\_npx\135796\node_modules\create-playwright\lib\index.js:4519:39)
    at Generator.run 
        (C:\Users\...\AppData\Roaming\npm-cache\_npx\135796\node_modules\create-playwright\lib\index.js:4593:5)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async C:\Users\...\AppData\Roaming\npm-cache\_npx\135796\node_modules\create-playwright\lib\index.js:4770:3 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 30724,
  stdout: null,
  stderr: null
}

Based on #9858 i wondered if using an elevated nodes.js command-prompt would solve this issue but even with an elevated node-prompt i did run into the same issue. I guess that our proxy / firewall blocks the URI to the browser files?!

But Playwright getting started also mentions:

You can optionally install only selected browsers, see install browsers for more details. Or you can install no browsers at all and use existing browser channels.

Continue at top.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ltsudacommented, Mar 25, 2022

I didn’t try to reproduce but if you think it’s a proxy issue, can you try the following?

https://playwright.dev/docs/browsers#install-behind-a-firewall-or-a-proxy

0reactions
dgozmancommented, Mar 26, 2022

Firefox ESR is not supported, sorry.

If you follow the Getting Started guide, it explains the configuration file. When you run npm init playwright, it printed the line that shows where you can find the config file. Explore it to see how channel: chrome is used.

Writing play-hello-powershell-admin\playwright.config.js.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Playwright getting started using existing browser
What do i have to do to create a playwright project using existing browser? Where do i have to put the provided config...
Read more >
Selenium: Attach to an Existing Chrome Browser with C# ...
Using the power of Chrome to verify existing browser sessions during testing with Selenium so that you can verify items on the page....
Read more >
Answers to All The Top Questions For Playwright Testing
All the top answers to your favorite questions on the hottest new testing framework from Microsoft, Playwright.
Read more >
Frequently Asked Questions - Chrome Developers
This document answers some frequently asked questions about Native Client (NaCl) and Portable Native Client (PNaCl, pronounced “pinnacle”).
Read more >
How the web works - Learn web development - MDN Web Docs
As the browser parses the HTML, it sends requests back to the server for any CSS files it has found from <link> elements,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found