const el = await page.waitForSelector("::p-xpath(///div[@role='button' and text()='Next'])");
await el.click();
you can do this for selecting element with xpath for puppeteer latest version
Reference : https://pptr.dev/guides/page-interactions/#xpath-selectors--p-xpath