I am first time learner of Selenium with Python and I am 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". The script which I provided below is not able to click on "Open" or "Save" or "Save as" to save the file in to the desired default location on the system whoever run the script. Once the file is stored in to a path in local machine then the script need to upload the same downloaded spread sheet using the link "Process New Spreadsheet" in the same application.
Could you please help me to give the complete code to "Save as" the downloaded spread sheet in to a default path in the System and then the code to have the same spread sheet uploaded using the link "Process New Spread sheet" link which is present in the same application.
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) profile.set_preference('browser.helperApps.neverAsk.saveToDisk', "application/xml,text/xml") class textpath(object): pass driver.find_element_by_name("Internet Explorer").send_keys(textpath) driver.find_element_by_name('Save as').click() driver.find_element_by_id('Save as').click()