Create a Firefox profile and add required add-ons.
Take ‘Firebug’ as an example, save the Firebug XPI into the C:FF_addons folder as firebug.xpi (Download XPI file from Firebug download page, right-click on the “Download Now” and save as C:FF_addonsfirebug.xpi).
Then create a Firefox profile and add Firebug add-on while instantiating FirefoxDriver as below:
String firebugFilePath = "C:\FF_addons\firebug.xpi";
FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(new File(firebugFilePath));
// Add more FF addons if required
WebDriver driver = new FirefoxDriver(profile);