Save Button in Save as Dialogue Box Window

Hi Guys,

please anybody give me a solution for the ruby code for the save button
in save as dialogue box.

actually am using this code for save a page


But issue is that if am using the above code, a save as dialogue box
will open (please see the attachment image). But after that i dont know
which is the ruby code for clicking the save button in this window. so
please anybody give me a better solution.


Have you read the Watir guide about downloads?


already i use this code. but it will not success my work. is there any
other solution


If all you want to do is save the page source, why are you pressing
Control S when you could just take all the html and write it into a

File.write( ‘myfile.htm’, @browser.html )

Hello Joel,

Thank you for your reply…

actually the main issue is that when i press submit button from my main
page and my output shown in another page, but the url of my output page
look like this.(eg:

so can you please give me a solution for saving this page as pdf format.
i try almost every code. please give me a good solution…


Wait… are you trying to convert a HTML page into a PDF file, or are
you trying to save a PDF file that’s being displayed in Chrome?

Yes…am trying to convert a HTML page(eg: into a pdf

There’s nothing built into webdriver that I know of able to handle
chrome’s print to PDF. You’ll need to find a chrome extension with an
API that can do this, save the HTML as shown above and then convert to
PDF, or manually send keypresses (although the latter is usually
unstable and considered bad coding).