-
Notifications
You must be signed in to change notification settings - Fork 193
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] Java Handle New Page #627
Comments
See this guide. You need to wrap the click into Page popup = page.waitForPopup(() -> {
page.click("<your button selector>");
}); |
So I am using this snippet:
However I am getting a timeout exception, as it cannot find the popup / print the content. Any idea? |
Does the popup show up? |
Yes it does. Maybe it's more likely a tab? As you can see at the screenshot above. |
If it's a window opened by the page as a result of the click it must be intercepted. If it's not there it means that it was either opened before the call or it is not opened by the page (Could it be that you have an extension that opens the child window?). You can also listen for all pages created in the context via |
Yes, you are right. It is an extension, which opens the windows after clicking a button. I am using Firefox. What would be the best solution in my case? |
We don't support extensions in Firefox yet, you can +1 this bug if you are interested in it. |
Thank you. How can I use playwright with extensions - will chromium work? If yes, can you show me the corresponding doc page? |
Is there also a description in Java? If not, could you please be so kind and send me a code snippet, which would solve my issue? Really appreciated. Also, thanks for the fast answers. |
Sorry, I forgot to mention that the background pages API is not exposed in Java, there is a feature request for that, so far we've been resisting it as it is a not a standard web api. |
Hello,
The website I would like to handle forces interaction with a new tab, which opens after clicking a button. It looks like this: (See attached screenshot)
Main aim is to wait for the popup, print the source code and click on "Go" afterwards.
Could you be so kind and attach the Java code snippet for this please? I already had a look at Java docs, but could not integrate it.
Thank you very much.
The text was updated successfully, but these errors were encountered: