New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Regression]: Within VS Code, Firefox window does not open in headed mode and generate an error #30660
Comments
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? |
Yes my machine is managed by our IT team and has corporate softwares on it (Microsoft Office 365 and many others). |
Interesting! Could you please try the following?
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. |
Hi, Here below is the output of the test program you asked me to run. By the way, a chromium window opened correctly:
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:
|
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): 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 leave it to you to close this ticket and remain at your disposal for any further information you may require. |
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. |
Last Good Version
1.37.1
First Bad Version
1.38.1
Steps to reproduce
Perform a fresh install for a given version: npm install @playwright/[email protected]
Install the browsers: npx playwright install
Run VS Code in the installation directory.
In Playwright section, check the "Show browser" checkbox:
Select default profile "Chromium", and run the 1st test of the provided sample: tests/example.spec.js
==> test is successful:
Select default profile "Firefox", and run the 1st test of the provided sample: tests/example.spec.js
==> test fails:
Test timeout of 30000ms exceeded while setting up "page".
Error: browserContext.newPage: Target page, context or browser has been closed
Expected behavior
When Firefox is selected as the default profile, the browser window should open and the test must pass correctly.
By the way, the same tests pass like a charm for Chromim and Webkit profiles.
Actual behavior
The Firefox browser window does not open but appears in the task bar:
When hovering over the Nightly browser icon, an empty window appears but nothing happen when clicking on it.
A timeout is generated with the following errors:
Additional context
I've already tested this issue with the following versions of Playwright:
v1.35.1, v1.36.1, and v1.37.1 ==> no error.
I've noticed that v1.37.1 is the latest release using Firefox browser v115.
v1.38.1, v1.39.1, v1.40.1, v1.41.2, v1.42.1, and 1.43.1 ==> the error occurs!
For Playwright v1.43.1, I've activated the debug mode (through env var DEBUG=pw:browser* ), and I got the following trace:
Environment
The text was updated successfully, but these errors were encountered: