[Question] Getting-started more details for use existing browser needed
See original GitHub issueWhere 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:
- Created a year ago
- Comments:5 (4 by maintainers)
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
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 howchannel: chrome
is used.