[Question] Allow Playwright to retrieve url from non existing pages.
See original GitHub issueHello, I made a similar question a month ago. Currently, I am testing sign-in functionality. Within the sign-in URL, there is a redirect URL that has functionality that when the user login successfully user gets redirected to the “redirect” URL with code, which later is used for other purposes. A redirect URL is not always an existing page, it is just a URL with code that has no content on it. Sometimes redirect URL does not even exist or it is just localhost with specific code on the end of the URL. With Playwright I am trying to sign in a user and then retrieve a redirect URL but somehow on the Chrome browser I only get this error:
chrome-error://chromewebdata/
But when I run this same test with the headless feature turned off this is what I see:
Picture: https://imgur.com/a/wl0XcJO
Previous issue: #995
I assume that Chrome could not connect to the non-existing page but how could I get only the URL from that non-existing page? Is it even possible?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (3 by maintainers)
Hi Yury, I tried something page.waitingForUrl() but incorrect way as per your explanation Ill check it tomorrow. We are currently using HtmlUnit and urls are loaded directly to List <String> but trying to move to playwright.
Many thanks for explanation Best regards Juraj Valkovic
Dňa po 22. 8. 2022, 23:16 Yury Semikhatsky @.***> napísal(a):
We managed to fix this issue with your solution. As you said before we established a listener on request
waitForRequest
. After that only what it did is to print outrequest.url()
and we got redirected URL with an authentication code.Thank you for your assistance Yuri, Best regards, Ivan Rener