Selenium disables plugins in firefox profile

Can someone tell me how to disable plugins for my user firefox profile using Java? I found several sites showing the addition of add-ons, but nothing about disabling plugins.

My firefox profile:

FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.setAcceptUntrustedCertificates(true); firefoxProfile.setAssumeUntrustedCertificateIssuer(false); firefoxProfile.setPreference("browser.download.folderList",2); firefoxProfile.setPreference("browser.download.manager.showWhenStarting",false); firefoxProfile.setPreference("browser.download.dir",reportFolder); firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv,application/pdf,application/csv,application/vnd.ms-excel"); firefoxProfile.setPreference("browser.download.manager.showAlertOnComplete",false); firefoxProfile.setPreference("browser.download.manager.showAlertOnComplete",false); firefoxProfile.setPreference("browser.download.manager.showWhenStartinge",false); firefoxProfile.setPreference("browser.download.panel.shown",false); firefoxProfile.setPreference("browser.download.useToolkitUI",true); firefoxProfile.setPreference("pdfjs.disabled", true); firefoxProfile.setPreference("pdfjs.firstRun", false); driver = new FirefoxDriver(firefoxProfile); 

By default, the problem is with some plugins. Adobe acrobat, google update, java, Microsoft office, flash, shock wave for director and Silverlight.

I need to disable some of them as they confuse my tests.

+6
source share
1 answer

If you do not create a profile that explicitly installs Firefox extensions / plugins, Selenium Webdriver will create an empty profile and use it.

Can you show us what code you use to invoke the FF driver?

+2
source

Source: https://habr.com/ru/post/946188/


All Articles