← Back to Discord Forum

When running in headless mode, Unable to verify new tab URL.

When click on Download button, it opens a PDF file in new tab in the browser. I've to validate the URL of the PDF document but in headless mode it is not working. However in headed mode the test is passing.

await this.btnDownloadDoc.last().click()
let downloadedDocURL = page.context().pages()[1].url()
console.log("downloadedDocURL: ", downloadedDocURL)

Your help is highly appreciated.


This thread is trying to answer question "How can the user verify the URL of a PDF document opened in a new tab when running in headless mode?"

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.