Handling popups in Playwright means matching one of three mechanisms to what the page is actually doing: an in-page modal is DOM you locate and click, a native dialog (alert, confirm, prompt, ...