TestProject Forum

Unable to dismiss a Chrome Print Alert for a (Non-Headless) Chrome Brower

Hello TestProject Community,

Our QA team is having an issue dismissing a Chrome Print Alert for a Chrome Brower (Non-Headless) using a variety of the following Actions:

  • Send “ESCAPE” to alert
  • Send “ESCAPE” key(s)
  • Clicks at “1” , “1” coordinates
  • Presses and releases ESC (Robot)
  • Dismiss alert (Robot)
  • Click Element; tried creating Element Locators for the Cancel button on the Chrome Print modal, but TestProject can’t interact with it despite using CSSSELECTORS or XPATH.

We’ve tried a number of things to address this because we’d like to have our Automation Suite successfully passing Tests on Non-Headless and Headless browsers in parallel, but this scenario is posing some frustration.

Other considerations:

  • We need to dismiss the Alert so we can conduct subsequent Tests on the page thereafter. For context, it doesn’t seem like TestProject is able to interact with Chromes Print Alert after it is instantiated, hence the issue.
  • We’d also like to avoid disabling the Print Alert. Ultimately the solution we’re trying to find is to exit the Print popup with the most “natural” workflow as much as possible to emulate the End User Experience.

Has anyone else encountered this scenario and were you able to resolve it?

Thanks in advance!

Respectfully,

  • Chris

Hi @ckent,
First you can close the print dialog by using the action click on close in the print dialog.
About interacting with the page in the print dialog, you are correct and indeed its not currently supported
What you can do is instead of closing try downloading the file in the print dialog and then use the our PDF action addon to interact with the pdf file like get character is pdf or if pdf contains text and more.

Please let me know if you managed to implement this.

Hello @Tal.Efraim,

Thank you for the prompt reply. Upon searching, I was unable to find the “Click on Close” Action or anything named similar, am I using the correct name?

Regarding the PDF suggestion, that is not the route we’d like to take. We have no need to interact with a PDF version or download anything from the Chrome Print Alert. We just need to dismiss/close it, so we can interact with the page itself in the background behind the Chrome Print Alert that appears. However, TestProject can’t seem to interact with the Chrome Print Alert which you’ve just confirmed.

Any other idea’s you might have? Thanks!

Respectfully,

  • Chris