Selenium: Saving pdf which is opened in new browser without url

Viewed 12039

Can someone guide me how I can achieve the following:

I am using selenium web driver java.

Whenever I click the preview button on the webpage, the pdf is opened in a new browser and I need to save that pdf with the name given dynamically.

So far I am able to click the preview button and a new browser is opened with the pdf. Here the browser doesn't have url.

After the pdf is open I am sending keys control+s.

Then save dialog window appears. I am stuck here about how to save pdf to the local drive.

The main browser is IE but i am trying in Firefox first

enter image description here

2 Answers
Related