Reputation: 41
I wrote test case to click on download button. How to go to download confirmation pop up window and select save or open option, and click ok and come back to main window. I am using selenium-python script for web test automation.
Upvotes: 3
Views: 5431
Reputation: 21
you can switch the on the Pop-Up and confirm it, but I don't know to manage if.... Try that:
alert = browser.switch_to_alert()#switch to popup
alert.accept()#accept popup
Upvotes: 0
Reputation: 91
I think this question has been answered here before and the answer is using another tool for automating the browser's dialog e.g. autoit How do we download a file by using Selenium?
Upvotes: 0
Reputation: 4534
Selenium can't control the download confirmation. It can, however, type a file path directly in to the file upload field if you're using a "privileged" browser mode for IE or Firefox. If you're using the default *iexplore and *firefox modes with Selenium RC 1.0 beta 2, try simply type a file path directly in to the form field. I do this myself and it works great.
Upvotes: 1