Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static SeleniumUtil initFirefoxDriver(String installationPath) throws IOException {
- FirefoxBinary binary = null;
- if (System.getProperty("os.name").startsWith("Windows")) {
- binary = new FirefoxBinary(new File(installationPath + "/firefox.exe"));
- } else {
- binary = new FirefoxBinary(new File(installationPath + "/firefox"));
- }
- FirefoxProfile profile = new FirefoxProfile();
- File dir = new File(installationPath + "-addons");
- File[] addonFiles = dir.listFiles(FileUtil.getExtensionFilter(".xpi"));
- for (File addonFile : addonFiles) {
- profile.addExtension(addonFile);
- }
- profile.setPreference("extensions.firebug.currentVersion", "1.9.2b1");
- // wait times out after 5 seconds
- return new SeleniumUtil(new FirefoxDriver(binary, profile), 5);
- // driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement