Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How to handle firefox download pop up in Selenium Webdriver?

Hi, I am trying to disable Firefox download dialog through firefox profile so that it does not prompts for file download . Below is the code snippet : FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.download.folderList",2); profile.setPreference("browser.download.manager.showWhenStarting",false); profile.setPreference("browser.download.dir", "C:\\HM Download" ); profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/pdf"); driver = new FirefoxDriver(profile); But it is not working. Download dialog still shows up Please provide me a genuine solution

user-image
Question ajoutée par MOHD AMIR MERAJ , Senior Software Quality Engineer , TCS
Date de publication: 2013/07/12
Raju Tandukar
par Raju Tandukar , Sr. Software QA Engineer , Verisk Information Technology

Try below code

FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.setPreference("browser.download.folderList",2); firefoxProfile.setPreference("browser.download.manager.showWhenStarting",false); firefoxProfile.setPreference("browser.download.dir","c:\\\\downloads"); firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv"); WebDriver driver = new FirefoxDriver(firefoxProfile);//new RemoteWebDriver(new URL("http://localhost:/wd/hub"), capability); driver.navigate().to("http://www.myfile.com/hey.csv");

gowthami muthusamy
par gowthami muthusamy , automation lead , Tata Consultancy Services - Other Locations

You can use Robot key  to  perform action with popup windows

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?