Giter Club home page Giter Club logo

Comments (6)

mxschmitt avatar mxschmitt commented on June 8, 2024

I tried to reproduce on Windows 11 and macOS 14, both ran without any issues.

Is your machine managed or has cooperate software installed on it?

from playwright.

JMG74 avatar JMG74 commented on June 8, 2024

Yes my machine is managed by our IT team and has corporate softwares on it (Microsoft Office 365 and many others).

from playwright.

mxschmitt avatar mxschmitt commented on June 8, 2024

Interesting! Could you please try the following?

  1. Create a file test.mjs with the content below
  2. Run it (node test.mjs) with having the DEBUG=pw:browser env var set (in PowerShell e.g. $Env:DEBUG="pw:browser")
import { chromium, expect } from '@playwright/test';

(async () => {
  const browser = await chromium.launch({ headless: false, slowMo: 100 });

  {
    const context = await browser._newContextForReuse();
    const page = await context.newPage();

    await page.goto('https://playwright.dev/');
    await expect(page).toHaveTitle(/Playwright/);
  }

  {
    const context = await browser._newContextForReuse();
    const page = context.pages()[0];

    await page.goto('https://playwright.dev/');

    await page.getByRole('link', { name: 'Get started' }).click();
    await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
  }

  await browser.close();
})();

This might give us more debug output while mimicking what we do inside the extension.

from playwright.

JMG74 avatar JMG74 commented on June 8, 2024

Hi,

Here below is the output of the test program you asked me to run. By the way, a chromium window opened correctly:

  pw:browser <launching> C:\Users\xxxx\AppData\Local\ms-playwright\chromium-1112\chrome-win\chrome.exe --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 --no-sandbox --user-data-dir=C:\Users\xxxx\AppData\Local\Temp\playwright_chromiumdev_profile-aoNOCG --remote-debugging-pipe --no-startup-window +0ms
  pw:browser <launched> pid=3148 +34ms
  pw:browser [pid=3148][err] [3148:4124:0507/064126.456:ERROR:chrome_browser_cloud_management_controller.cc(161)] Cloud management controller initialization aborted as CBCM is not enabled. Please use the `--enable-chrome-browser-cloud-management` command line flag to enable it if you are not using the official Google Chrome build. +454ms
  pw:browser [pid=3148] <gracefully close start> +2s
  pw:browser [pid=3148] <process did exit: exitCode=0, signal=null> +339ms
  pw:browser [pid=3148] starting temporary directories cleanup +1ms
  pw:browser [pid=3148] finished temporary directories cleanup +17ms
  pw:browser [pid=3148] <gracefully close end>

The test you ask me to run concerns the chromium browser but I do not have any problem with chromium... my problem is only with firefox... then I ran the same test program where I replaced the string "chromium" by "firefox" and here is the resulting output. During the test, no window opened for Firefox:

  pw:browser <launching> C:\Users\xxxx\AppData\Local\ms-playwright\firefox-1447\firefox\firefox.exe -no-remote -wait-for-browser -foreground -profile C:\Users\xxxx\AppData\Local\Temp\playwright_firefoxdev_profile-5EqNMJ -juggler-pipe -silent +0ms
  pw:browser <launched> pid=12764 +12ms
  pw:browser [pid=12764][err] JavaScript warning: resource://services-settings/Utils.sys.mjs, line 114: unreachable code after return statement +163ms
  pw:browser [pid=12764][out] console.warn: services.settings: Ignoring preference override of remote settings server +2ms
  pw:browser [pid=12764][out] console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment +0ms
  pw:browser [pid=12764][out] console.error: ({}) +305ms
  pw:browser [pid=12764][out]  +4ms
  pw:browser [pid=12764][out] Juggler listening to the pipe +0ms
  pw:browser [pid=12764][out] console.error: "Warning: unrecognized command line flag" "-foreground" +33ms
  pw:browser [pid=12764][out] console.error: SearchEngineSelector: "Received empty search configuration!" +2s
  pw:browser [pid=12764][out] console.error: SearchEngineSelector: "Received empty search configuration!" +109ms
  pw:browser [pid=12764][out] console.error: SearchService: "#init: failure initializing search:" ({}) +0ms
  pw:browser [pid=12764][err] JavaScript error: resource://gre/modules/SearchEngineSelectorOld.sys.mjs, line 118: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings +13ms
  pw:browser [pid=12764][out] console.error: "Received empty top sites configuration!" +1ms
  pw:browser [pid=12764][err] JavaScript error: resource://gre/modules/SearchEngineSelectorOld.sys.mjs, line 118: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings +0ms
  pw:browser [pid=12764][err] JavaScript error: resource://gre/modules/SearchEngineSelectorOld.sys.mjs, line 118: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings +0ms
  pw:browser [pid=12764][err] JavaScript error: resource://gre/modules/SearchEngineSelectorOld.sys.mjs, line 118: NS_ERROR_UNEXPECTED: Failed to get engine data from Remote Settings +4ms
  pw:browser [pid=12764][out] console.error: "Received empty top sites configuration!" +2ms
  pw:browser [pid=12764][out] console.error: WebExtensions:  +118ms
  pw:browser [pid=12764][out]   Message: [Exception... "Failed to get engine data from Remote Settings"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: resource://gre/modules/SearchEngineSelectorOld.sys.mjs :: getEngineConfiguration :: line 118"  data: no] +0ms
  pw:browser [pid=12764][out]   Stack: +0ms
  pw:browser [pid=12764][out]     getEngineConfiguration@resource://gre/modules/SearchEngineSelectorOld.sys.mjs:118:24 +0ms
  pw:browser [pid=12764][out]  +0ms
  pw:browser [pid=12764][err] JavaScript error: , line 0: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable +538ms
  pw:browser [pid=12764][err] JavaScript error: , line 0: TypeError: can't access dead object +8ms
  pw:browser [pid=12764][out] console.error: SearchSettings: "_write: Could not write to settings file:" (new Error("cannot write without any engine.", "resource://gre/modules/SearchSettings.sys.mjs", 277)) +154ms
  pw:browser [pid=12764] <gracefully close start> +461ms
  pw:browser [pid=12764] <process did exit: exitCode=0, signal=null> +730ms
  pw:browser [pid=12764] starting temporary directories cleanup +0ms
  pw:browser [pid=12764] finished temporary directories cleanup +20ms
  pw:browser [pid=12764] <gracefully close end>

from playwright.

JMG74 avatar JMG74 commented on June 8, 2024

Based on previous test with firefox browser, I tried some complementary investigations by launching manually firefox browser window (based on the command appearing at the beginning of the debug trace):
With the command "C:\Users\xxxx\AppData\Local\ms-playwright\firefox-1447\firefox\firefox.exe -no-remote -wait-for-browser -foreground", a Nightly/Firefox window opens correctly.

The name of the directory used for the "-profile" parameter is currently "C:\Users\xxxx\AppData\Local\Temp\playwright_firefoxdev_profile-5EqNMJ", and I noticed that I have also a directory called "C:\Users\xxxx\AppData\Local\Temp\playwright_firefoxdev_profile" created a few days ago.
I thought I could have had a problem when removing those temporary directories, and I tried to remove them manually... and you know what ? now everything is working properly with firefox browser 👍👍👍
My problem seems fixed!!

I leave it to you to close this ticket and remain at your disposal for any further information you may require.

from playwright.

mxschmitt avatar mxschmitt commented on June 8, 2024

Impressive! I suspect that some anti-virus / policy software on your system didn't like our Firefox browser getting launched by Playwright initially but if you do it manually, it shows them that this is an intentional execution.

Closing by that.

from playwright.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.