Reputation: 181
I am using Selenium Webdriver for Automation. Lately I have a need where I open a webpage, install a plugin(in the backend) and click a button. The button detects the installed plugin and lets me continue.
I can see this working in the normal firefox window. But somehow the WebDriver initiated firefox does not allow the same. The plugin is instantiated in the webpage and the button gets enabled.
I could install the plugin and see it in Add Ons page but the button is not getting enabled.
Is there a way I can force the webdriver to reload all the plugins or is there any security issue due to which webdriver is preventing the plug in from being instantiated?
Thanks in advance
Upvotes: 1
Views: 1931
Reputation: 5080
If you want to use Add-on's
mean you have to create a profile for Firefox and include add on's in that profile that is launched by the web driver applications. This will allow you to have access to the `Web Element' through add-on's. I am not sure how it will react. I didn't tried not yet. But this the way to use plug-in to the launched browser.
File file = new File("firebug-1.8.1.xpi");
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.addExtension(file);
firefoxProfile.setPreference("extensions.firebug.currentVersion", "1.8.1"); // Avoid tartup screen
WebDriver driver = new FirefoxDriver(firefoxProfile);
Reference from - http://code.google.com/p/selenium/wiki/FirefoxDriver
Upvotes: 1