Search the Community

Showing results for tags 'dialog box'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. I am using "Python-3.4.1 32 bit" on "Windows 7 64 bit" machine with "Selenium" using "Firefox 33". I am trying to automate downloading a "CSV" file from a secured website after furnishing the necessary credentials. I have written the required code to navigate to the correct element to initiate the download of the file but I am stuck when Firefox gives the download box (Dialog box title: Opening export.csv, "Open with" and "Save File" options as radio buttons with "OK" and "Cancel" as buttons). I want the file to be downloaded automatically and for that I have tried the following codes without success: from selenium import webdriverfp = webdriver.FirefoxProfile()fp.set_preference("browser.download.manager.showWhenStarting",False)fp.set_preference("browser.download.folderList",2)fp.set_preference("browser.download.dir", "C:UsersarunDownloads")fp.set_preference("browser.download.downloadDir", "C:UsersarunDownloads")fp.set_preference("browser.download.defaultFolder", "C:UsersarunDownloads")fp.set_preference('browser.helperApps.neverAsk.saveToDisk',"text/csv")driver = webdriver.Firefox(fp)driver.get("http://website-url.com") and then click on the button to start the download. But, it still shows the dialog box. I even tried handling it as an alert and tried alert = driver.switch_to_alert()alert.accept() but this always gave an exception of alert not found which led me to the conclusion that it might not be a JavaScript functionality after all but rather a web element. I am giving sufficient delay for the alert box to appear before I try to interact with it using the "alert" object code shown above.What do I do to get this downloaded automatically without the dialog box interaction (the way it's handled in Google Chrome browsers)I think that the server is not assigning the correct MIME type for the file that is being downloaded? The file I am downloading is of type: "text/csv" and in Firefox when the dialog box appears, "Do this automatically for files like this from now on" check box is greyed out.Thanks for your help and timeCheers!