Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

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 added by MOHD AMIR MERAJ , Senior Software Quality Engineer , TCS
Date Posted: 2013/07/12
Raju Tandukar
by 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
by gowthami muthusamy , automation lead , Tata Consultancy Services - Other Locations

You can use Robot key  to  perform action with popup windows

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.