2

I am trying to handle a Print Dialog in Chrome. But, Selenium is not able to interacts with it. Is it possible that I click on the Print Hyperlink, instead of opening the new tab with Print Dialog box, it Saves the next page content as PDF with required settings?

Or if I can somehow interact with the Print Dialog in Selenium or C# ?enter image description here

1 Answers1

1

You can use Action class in selenium to send keys to browser. If you want to cancel then send "Esc" else send "Enter" to save. After pressing save, save as dialog will appear which you can handle using AutoIt.

  • 1
    Hey Dhananjay. Thanks for answering but the thing is, I also want to set the Paper size to A4, Layout as Portrait, Pages to All and Paper Size to A4. Any workaround for that? – Mohinder Negi Sep 22 '22 at 14:52