Giter Site home page Giter Site logo

BrowserContext.pages() does not return the exact count of pages when new pages are launched by application under test (browser with extension)) about playwright-java HOT 5 CLOSED

Mani-151 avatar Mani-151 commented on June 12, 2024
BrowserContext.pages() does not return the exact count of pages when new pages are launched by application under test (browser with extension))

from playwright-java.

Comments (5)

Mani-151 avatar Mani-151 commented on June 12, 2024

@yury-s : Could you please help me here

from playwright-java.

yury-s avatar yury-s commented on June 12, 2024

Please provide a complete example which we could use to reproduce the issue locally.

from playwright-java.

Mani-151 avatar Mani-151 commented on June 12, 2024

I am sharing the below code, Could please check if the below code snippet can give you a better idea of the scenario which i am trying.
the application URL has restricted access, hence could not share the URL.

String extensionDirPath = PathToExtension
List args = new ArrayList<>(Arrays.asList(
"--disable-extensions-except=" + extensionDirPath,
"--load-extension=" + extensionDirPath,
"--use-fake-ui-for-media-stream",
"--use-fake-device-for-media-stream"
));
BrowserType browserType = playwright.chromium();
context = browserType.launchPersistentContext(tempUserDataDir, new BrowserType.LaunchPersistentContextOptions()
.setHeadless(false)
.setArgs(args)
Page page = context.newPage();
Page.navigate("application URL");
page.click("Xpath to button"); //This page opens up new tab

context.pages() --> Returns 1 , but expecting 2 as new tab is opened by click action which.
If we wait for 5-10 seconds , we are seeing the value as 2.

I tried using below

page=context().waitForPage(() -> {
page.locator('element locator').isVisible();
});

from playwright-java.

yury-s avatar yury-s commented on June 12, 2024

It has something to do with the extension. I cannot reproduce it with regular web pages. We need complete reproduction example.

from playwright-java.

mxschmitt avatar mxschmitt commented on June 12, 2024

Closing as part of the triage process since it seemed stale. Please create a new issue with a detailed reproducible or feature request if you still face issues.

from playwright-java.

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.