Skip to content
RED SAG Skills
mediumStudy question · answer published in Playwright interview questions, so no pointsui-automationplaywright

Checking a downloaded report

Clicking "Download CSV" starts a file download. What is the correct Playwright pattern?

const downloadPromise = page.waitForEvent('download')
await page.getByRole('button', { name: 'Download CSV' }).click()
const download = await downloadPromise
await download.saveAs('out/report.csv')
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions