ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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
تم إضافة السؤال من قبل MOHD AMIR MERAJ , Senior Software Quality Engineer , TCS
تاريخ النشر: 2013/07/12
Raju Tandukar
من قبل 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
من قبل gowthami muthusamy , automation lead , Tata Consultancy Services - Other Locations

You can use Robot key  to  perform action with popup windows

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟