const downloadPromise = page.waitForEvent('download');
await page.getByText('Download file').click();
const download = await downloadPromise;
// FAILS: download.path() fails when connecting to a remote browser// const result = fs.readFileSync(await download.path(), 'utf-8');// FIX: use saveAs() to download the file, when connecting to a remote browserawait download.saveAs('/path/to/save/at/' + download.suggestedFilename());