-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Question] New browser windows are opened instead of tabs on every newPage() #5034
Comments
Yes, this intentional behavior. Each page is opened in its own window. We had to split it for video recording to properly work in other browsers and wanted to keep it consistent across browsers. Moreover, in your code snippet each page created by const context = await browser.newContext();
const page = await context.newPage(); Is there a test scenario that doesn't work with separate window per page approach? |
@yury-s Yes it doesn't work when you are using headful mode and vnc server. If it was multi tab we could access all tab easily but multiple windows are not accessible. We test chat application and it has become too annoying. and we need headful mode because some of the tests are done in headful mode with manual intervention. It only happens in launchPersistantContext . |
It is unclear why vnc has a problem with multiple windows though? |
@pavelfeldman vnc is always like that. When there is window on top on another window old window is hidden . And its usually hard to manage window and tabs are easier to manage in heedful mode too. |
But there is bringToFront that is equivalent to surfacing the tab or does that not work? |
Well, our use case is not exactly related to testing but scrapping at high volume. Thus, opening many windows paralelly would hamper the memory footprint of our apps. |
Trying to use a single browser instance with mutiple sessions (pages/ tabs), but on every newPage() a new window is launched instead of a tab.
main.js
At this point browser window is not opened. (Unlike puppeteer which opens a new browser window on launch)
/lib/other.js
Now a new browser window is opened every time newPage is called, instead of opening a new page in the existing window.
So, Is this the expected behaviour with PlayWright?
NOTE: Puppeteer would open a window once (on launch) and add tabs on every newPage().
The text was updated successfully, but these errors were encountered: