I Need to handle Print Preview App Dialog Box. But I am not able to do that with Selenium C#. How can I do it? The Print Preview opens in another tab

199 views Asked by At

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

There are 1 answers

1
Dhananjay Jadhav On

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.