microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
67.19k stars 3.69k forks source link

Chrome browser is not launching #33757

Open Shubhamrk10-JS opened 10 hours ago

Shubhamrk10-JS commented 10 hours ago

Please do not submit this issue.

Shubhamrk10-JS commented 10 hours ago

Getting below error message after giving "npx playwright test xvfb-run node LocateElement.spec.js --project=chromium --headed" cmd:

Running 1 test using 1 worker 1) [chromium] › LocateElement.spec.js:3:1 › Locaters ─────────────────────────────────────────────

Error: browserType.launch: Target page, context or browser has been closed
Browser logs:

╔════════════════════════════════════════════════════════════════════════════════════════════════╗
║ Looks like you launched a headed browser without having a XServer running.                     ║
║ Set either 'headless: true' or use 'xvfb-run <your-playwright-app>' before running Playwright. ║
║                                                                                                ║
║ <3 Playwright Team                                                                             ║
╚════════════════════════════════════════════════════════════════════════════════════════════════╝
Call log:
  - <launching> /home/node/.cache/ms-playwright/chromium-1148/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding,ThirdPartyStoragePartitioning,LensOverlay,PlzDedicatedWorker --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --disable-search-engine-choice-screen --unsafely-disable-devtools-self-xss-warnings --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-YIc3iY --remote-debugging-pipe --no-startup-window
  - <launched> pid=41835
  - [pid=41835][err] [41835:41835:1125/170635.266303:ERROR:ozone_platform_x11.cc(244)] Missing X server or $DISPLAY
  - [pid=41835][err] [41835:41835:1125/170635.266350:ERROR:env.cc(257)] The platform failed to initialize.  Exiting.
  - [pid=41835][err] [41835:41849:1125/170635.266610:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory

1 failed [chromium] › LocateElement.spec.js:3:1 › Locaters ──────────────────────────────────────────────

Shubhamrk10-JS commented 10 hours ago

Playwright Version: [v1.49.0] npm: 10.8.3 Operating System: [Debian 12]

mxschmitt commented 9 hours ago

It looks like your system has no desktop environment configured. Why do you want to run your tests headed? We recommend running them headless on CI.