Handling Chrome popups in Ruby using Watir

Hi All,

I am trying to handle the chrome popup that shows when saving some file
“Keep and Discard” in my Automation Script.But no luck i tried
RAutomation even then no luck.

Can someone help how to handle this in Ruby Automation using

Thanks in Advance

If you launch with these profile settings do you still get the error?

profile = Selenium::WebDriver::Chrome::Profile.new
profile[‘download.prompt_for_download’] = false
profile[‘download.default_directory’] = “/path/to/dir”
b = Watir::Browser.new :chrome, :profile => profile

What exactly does the “Keep and Discard” message say? Is the MIME type
of the file a dangerous one?