Manage Download Confirm Download popup using selenium script

I wrote a test case to click the download button. How to go to the download confirmation window and select the save or open option and click "OK" and return to the main window. I am using a selenium-python script to automate web testing.

+3
source share
3 answers

Selenium cannot control download confirmation. However, it can specify the file path directly in the file download field if you use the "privileged" browser mode for IE or Firefox. If you use the default * iexplore and * firefox modes with Selenium RC 1.0 beta 2, just try entering the file path directly into the form field. I do it myself and it works great.

+1
source

I think this question was answered here earlier, and the answer uses another tool to automate the browser dialog box, for example. AutoIt How to upload a file using Selenium?

0
source

, , , ... :

alert = browser.switch_to_alert()#switch to popup
alert.accept()#accept popup
0
source

Source: https://habr.com/ru/post/1703402/


All Articles