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.
<#1054804523652231198>
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?"
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 [email protected].