I'm a first time learner of Selenium with Python and I'm facing the below issue: When I click on a Download template link in an application, the OS give the User with the options Open or Save or Save as.
It looks like the Selenium webdriver with Python can not support the OS level popup window and we need to use AutoIT or Robot.
The user Minion4 has suggested to use Robot. The comments are below:
The Robot class(java.awt package) should work. Please go through this blog for a better understanding http://ardesco.lazerycode.com/index.php/2012/07/how-to-download-files-with-selenium-and-why-you-shouldnt/
In this link the Java code is provided. I'm not very clear on how to use this Java code in my Selenium webdriver python script provided below.
Could you please help me how do I use the Robot Java code to be called from the Selenium webdriver Python script in order to Open or Save or Save as the excel file in to any desired location.
Appreciate your help.
Below is the code which work till clicking on the Download Template link
import time
from selenium import webdriver
from webbrowser import Chrome
import profile
driver = webdriver.Ie('C:/Selenium/IEDriverServer') # Optional argument, if not specified will search path.
driver.get('http://vmslccb05:8082/');
time.sleep(5) # Let the user actually see something!
link = driver.find_element_by_link_text('Download Template')
link.click()
time.sleep(5)