Reputation: 135
i'm trying to access new popup windows for google sign up in playwright and couldn't do it.
await page.waitForSelector(signUpWithGoogle, { state: 'visible' })
await page.focus(signUpWithGoogle)
await page.click(signUpWithGoogle)
await page.fill('//input[@type="email"]', email)
Upvotes: 3
Views: 2938
Reputation: 21695
You should wait for the popup and then action on it:
await page.waitForSelector(signUpWithGoogle, { state: 'visible' })
await page.focus(signUpWithGoogle)
const [popup] = await Promise.all([
page.waitForEvent('popup'),
page.click(signUpWithGoogle),
]);
await popup.fill('//input[@type="email"]', email)
Upvotes: 6