microsoft / playwright-java

Java version of the Playwright testing and automation library
https://playwright.dev/java/
Apache License 2.0
1.13k stars 205 forks source link

[Bug]: The playwright operation error occurs #1582

Closed wm475390847 closed 4 months ago

wm475390847 commented 4 months ago

Version

java-1.42.0

Steps to reproduce

Skipping browsers download because PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD env variable is set 2024-05-21 17:58:12,012 ERROR [main] t.o.i.DeployClient.openAuth:299 引入系统权限模块异常: Error { message='Target page, context or browser has been closed Browser logs:

/root/.cache/ms-playwright/chromium-1105/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --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 --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 --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-DdqLfg --remote-debugging-pipe --no-startup-window pid=109 [pid=109][err] /root/.cache/ms-playwright/chromium-1105/chrome-linux/chrome: 1: ]�: not found [pid=109][err] /root/.cache/ms-playwright/chromium-1105/chrome-linux/chrome: 1: ELF: not found [pid=109][err] /root/.cache/ms-playwright/chromium-1105/chrome-linux/chrome: 3: Syntax error: ")" unexpected [pid=109] [pid=109] starting temporary directories cleanup name='TargetClosedError stack='TargetClosedError: Target page, context or browser has been closed Browser logs: /root/.cache/ms-playwright/chromium-1105/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --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 --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 --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-DdqLfg --remote-debugging-pipe --no-startup-window pid=109 [pid=109][err] /root/.cache/ms-playwright/chromium-1105/chrome-linux/chrome: 1: ]�: not found [pid=109][err] /root/.cache/ms-playwright/chromium-1105/chrome-linux/chrome: 1: ELF: not found [pid=109][err] /root/.cache/ms-playwright/chromium-1105/chrome-linux/chrome: 3: Syntax error: ")" unexpected [pid=109] [pid=109] starting temporary directories cleanup at DispatcherConnection.dispatch (/tmp/playwright-java-2139922215644861000/package/lib/server/dispatchers/dispatcher.js:379:15) } Call log: - /root/.cache/ms-playwright/chromium-1105/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --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 ### Expected behavior The same code works fine on X86 architecture machines and has run on many machines, but an error is reported after switching to arm ### Actual behavior I only migrated the ms-playwright folder to the /roo/.cache folder to keep the docker image minimized and make the program available, but it ran incorrectly ### Additional context What I did: I used the initial program to automatically download playwright for everything, then stripped out the other browsers except chrome and bundled it into the docker image ![{2278f08c-071b-4c45-82e1-10c4cb90eca2}](https://github.com/microsoft/playwright-java/assets/68719907/196a4272-7c4f-4486-b019-704a1e8aa108) ### Environment - linux-arm - jdk8 - k8s pod pull docker image
yury-s commented 4 months ago

The same code works fine on X86 architecture machines and has run on many machines, but an error is reported after switching to arm

You need different binaries on x86 and arm. Make sure to download browsers matching your machine's arcitecture.

If you think this is a Playwright bug, please file a new issue and follow [BUG] template to provide exact steps how to reproduce it locally. The current report describes a bunch of manipulations from some docker images unrelated to playwright and playwright caches, which is not very helpful.