final String firebugPath = "C:\\FF_Profile\\firebug.xpi"; FirefoxProfile profile = new FirefoxProfile(); profile.addExtension(new File(firebugPath)); // Add more if needed WebDriver driver = new FirefoxDriver(profile);
FirefoxProfile firefoxProfile = new FirefoxProfile(); File extension = new File("extension.xpi"); firefoxProfile.addExtension(extension); DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability(FirefoxDriver.PROFILE, firefoxProfile); driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capabilities);
public void setExtensions(List<File> extensionToInstalls) throws IOException { for(File extensionToInstall : extensionToInstalls) { profile.addExtension(extensionToInstall); } }
public void addExtension(Class<?> loadResourcesUsing, String loadFrom) { // Is loadFrom a file? File file = new File(loadFrom); if (file.exists()) { addExtension(file); return; } addExtension(loadFrom, new ClasspathExtension(loadResourcesUsing, loadFrom)); }
/** * Attempt to add an extension to install into this instance. * * @param extensionToInstall File pointing to the extension */ public void addExtension(File extensionToInstall) { addExtension(extensionToInstall.getName(), new FileExtension(extensionToInstall)); }
public void addFirebugsTo(final FirefoxProfile profile) { try { profile.addExtension(this.getClass(), FIREBUGS_XPI_FILE); profile.setPreference("extensions.firebug.currentVersion", MAX_FIREBUGS_VERSION); // Avoid startup screen profile.addExtension(this.getClass(), FIREFINDER_XPI_FILE); profile.setPreference("extensions.firebug.currentVersion", MAX_FIREFINDER_VERSION); // Avoid startup screen } catch (IOException e) { LOGGER.warn("Failed to add Firebugs extension to Firefox"); } }
final String firebugPath = "C:\\FF_Profile\\firebug.xpi"; FirefoxProfile profile = new FirefoxProfile(); profile.addExtension(new File(firebugPath)); // Add more if needed WebDriver driver = new FirefoxDriver(profile);
public void addFirebugsTo(final FirefoxProfile profile) { try { profile.addExtension(this.getClass(), FIREBUGS_XPI_FILE); profile.setPreference("extensions.firebug.currentVersion", MAX_FIREBUGS_VERSION); // Avoid startup screen profile.addExtension(this.getClass(), FIREFINDER_XPI_FILE); profile.setPreference("extensions.firebug.currentVersion", MAX_FIREFINDER_VERSION); // Avoid startup screen } catch (IOException e) { LOGGER.warn("Failed to add Firebugs extension to Firefox"); } }
FirefoxProfile oProfile = new FirefoxProfile(); File extension = new File("scrapbook-1.5.11-fx.xpi"); try { oProfile.addExtension(extension); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } WebDriver driver = new FirefoxDriver(oProfile); driver.get("https://google.com"); new Actions(driver).sendKeys(Keys.chord(Keys.CONTROL,Keys.SHIFT, "D")).perform();
File profileDir = new File("path/to/top/level/of/profile"); FirefoxProfile profile = new FirefoxProfile(profileDir); File firebug = new File("C:\\FFPlugins\\firebug-1.7.3.xpi"); File xpathChecker = new File("C:\\FFPlugins\\xpath_checker-0.4.4-fx.xpi"); profile.addExtension(firebug); profile.setPreference("extensions.firebug.currentVersion", "1.7.3"); profile.addExtension(xpathChecker); profile.setPreference("extensions.xpath_checker.currentVersion", "0.4.4"); WebDriver driver = new FirefoxDriver(profile);
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 startup screen WebDriver driver = new FirefoxDriver(firefoxProfile);
File file = new File("path_to_firebug-2.0.17.xpi"); FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.addExtension(file); firefoxProfile.setPreference("extensions.firebug.currentVersion", "2.0.17"); WebDriver driver = new FirefoxDriver(firefoxProfile);
File file = new File("firebug-1.8.1.xpi"); FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.addExtension(file); firefoxProfile.setPreference("extensions.firebug.currentVersion", "1.8.1"); WebDriver driver = new FirefoxDriver(firefoxProfile);
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 startup screen WebDriver driver = new FirefoxDriver(firefoxProfile);
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 startup screen WebDriver driver = new FirefoxDriver(firefoxProfile);
Download the firebug xpi file from mozilla and start the profile as follows: 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 startup screen WebDriver driver = new FirefoxDriver(firefoxProfile);
File file = new File("java 6 plugin file"); FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.addExtension(file); firefoxProfile.setPreference("extensions.firebug.currentVersion", "1.8.1"); WebDriver driver = new FirefoxDriver(firefoxProfile);
private void addWebDriverExtension(FirefoxProfile profile) { if (profile.containsWebDriverExtension()) { return; } profile.addExtension("webdriver", loadCustomExtension().orElse(loadDefaultExtension())); }
private void addExtensions(FirefoxProfile profile) { JMeterProperty property = getProperty(EXTENSIONS_TO_LOAD); if (property instanceof NullProperty) { return; } CollectionProperty rows = (CollectionProperty) property; for (int i = 0; i < rows.size(); i++) { ArrayList row = (ArrayList) rows.get(i).getObjectValue(); String filename = ((JMeterProperty) row.get(0)).getStringValue(); profile.addExtension(new File(filename)); } }
@Override public void addExtension(String extensionName) { firefoxProfile.addExtension(ExtHelper.findExtension(extensionName, "xpi")); } }