FirefoxProfile profile = new FirefoxProfile(new File("D:\\Selenium Profile")); WebDriver driver = new FirefoxDriver(profile);
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);
File profileDirectory = new File("c://mach//lib//prof"); FirefoxProfile profile = new FirefoxProfile(profileDirectory); DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability(FirefoxDriver.PROFILE, profile); driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capabilities);
File pathToBinary = new File("C:\\user\\Programme\\FirefoxPortable\\App\\Firefox\\firefox.exe"); FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary); FirefoxProfile firefoxProfile = new FirefoxProfile(); WebDriver driver = new FirefoxDriver(ffBinary,firefoxProfile);
File pathToBinary = new File("C:\\Program Files\\Mozilla Firefox15\\Firefox.exe"); FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary); FirefoxProfile firefoxProfile = new FirefoxProfile(); FirefoxDriver _driver = new FirefoxDriver(ffBinary,firefoxProfile);
FirefoxProfile p = new FirefoxProfile(); p.setPreference("javascript.enabled", false); driver = new FirefoxDriver(p);
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);
@BeforeEach public void setup(@TempDirectory.TempDir Path folder) throws IOException { Assumptions.assumeTrue(Boolean.getBoolean("smoke.test"), "Smoke tests disabled (set System property 'smoke.test')"); this.downloadDir = folder.toFile(); FirefoxProfile fxProfile = new FirefoxProfile(); fxProfile.setPreference("browser.download.folderList", 2); fxProfile.setPreference("browser.download.manager.showWhenStarting", false); fxProfile.setPreference("browser.download.dir", this.downloadDir.getAbsolutePath()); fxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/zip,application/x-compress,application/octet-stream"); FirefoxOptions options = new FirefoxOptions().setProfile(fxProfile); this.driver = new FirefoxDriver(options); ((JavascriptExecutor) this.driver).executeScript("window.focus();"); Actions actions = new Actions(this.driver); this.enterAction = actions.sendKeys(Keys.ENTER).build(); }
FirefoxBinary binary = new FirefoxBinary(new File("path/to/binary")); FirefoxProfile profile = new FirefoxProfile(); WebDriver driver = new FirefoxDriver(binary, profile);
FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("javascript.enabled", false); WebDriver driver = new FirefoxDriver(profile);
FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("permissions.default.stylesheet", 2); profile.setPreference("permissions.default.image", 2); FirefoxDriver browser = new FirefoxDriver(profile);
File torProfileDir = new File( "...\\Tor Browser\\Data\\Browser\\profile.default"); FirefoxBinary binary = new FirefoxBinary(new File( "...\\Tor Browser\\Start Tor Browser.exe")); FirefoxProfile torProfile = new FirefoxProfile(torProfileDir); torProfile.setPreference("webdriver.load.strategy", "unstable"); try { binary.startProfile(torProfile, torProfileDir, ""); } catch (IOException e) { e.printStackTrace(); }
FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("network.proxy.type", 1); profile.setPreference("network.proxy.socks", "127.0.0.1"); profile.setPreference("network.proxy.socks_port", 9150); FirefoxDriver = new FirefoxDriver(profile);
private RemoteWebDriver webDriver(final String seleniumBrowser) { if ("chrome".equals(seleniumBrowser)) { return new ChromeDriver(); } if ("safari".equals(seleniumBrowser)) { return new SafariDriver(); } FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("focusmanager.testmode", true); return new FirefoxDriver(profile); } }
FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.download.panel.shown", false); profile.setPreference("browser.helperApps.neverAsk.openFile", "text/csv,application/vnd.ms-excel");
FirefoxProfile profile = new FirefoxProfile(); //explicitly enable native events(this is mandatory on Linux system, since they //are not enabled by default profile.setEnableNativeEvents(true); 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);
public static FirefoxProfile fromJson(String json) throws IOException { // We used to just pass in the entire string without quotes. If we see that, we're good. // Otherwise, parse the json. if (json.trim().startsWith("\"")) { json = new Json().toType(json, String.class); } return new FirefoxProfile(Zip.unzipToTempDir( json, "webdriver", "duplicated")); }
FirefoxProfile fxProfile = new FirefoxProfile(); fxProfile.setPreference("browser.download.folderList", 2); fxProfile.setPreference("browser.download.manager.showWhenStarting", false); fxProfile.setPreference("browser.download.dir","c:\\tmp"); fxProfile.setPreference("browser.helperApps.alwaysAsk.force", false); fxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream"); setDriver(TestBench.createDriver(new FirefoxDriver(fxProfile)));
FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.setPreference("browser.download.folderList",2); firefoxProfile.setPreference("browser.download.manager.showWhenStarting",false); firefoxProfile.setPreference("browser.download.dir","c:\\downloads"); firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv"); WebDriver driver = new FirefoxDriver(firefoxProfile);//new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability); driver.navigate().to("http://www.myfile.com/hey.csv");