I have two pages, page0
and page1
. I clicked a button in page1
, and it popup a blank page to load for 3-5 minutes. After that, it will popup a new page, and close all the pages except page0
. However, playwright lost the final page url. it only has the first page's url.
If anyone can help me to solve this problem, I'll be really grateful!
Here's my code
async with self.context.expect_event('page', timeout = 60000) as page2_info:
await page1.locator("#fraInterface").content_frame.get_by_role("button", name = "Finish Input").click()
page2 = self.context.pages[-1]
I tried to use two async to find the url, but it did not work. I also tried to use different method, such as change self.context.expect_event('page')
to page1.expect_popup()
. Both can not work in this situation.