← Back to Discord Forum

Script fails with 'Pending Operation' message

My code suddenly started to fail on a click operation with Pending Operation and Browser has been closed error. But the action is successfully performed on the browser DOM

this is what my code looks like:

async openReportByName(reportName: string) { let report: Locator = this.page.getByRole('link', { name: reportName }).last(); await test.step(Opening Report of Name: ${reportName}, async () => { await this.page.waitForLoadState('load', { timeout: 1000 }); await report.click({ delay: 3000 }); }) }

This thread is trying to answer question "Why is my code failing on a click operation with a 'Pending Operation' and 'Browser has been closed' error?"

0 replies
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.