Specified exising profile is not being used
Meta -
Version: geckodriver 20 Platform: Windows 10 Firefox: FF 58 Selenium: Selenium standalone 3.10
Selenium-java code is as follows,
String profileDir = "C:/Users/jlopez/AppData/Roaming/Mozilla/Firefox/Profiles/ddtkw80l.profile5902"; FirefoxProfile ffprofile = new FirefoxProfile();
FirefoxOptions options = new FirefoxOptions(); options.setBinary("C:\Program Files\Mozilla Firefox\firefox.exe"); options.addArguments("-profile", profileDir);
System.setProperty("webdriver.gecko.driver","C:\selenium\drivers\geckodriver.exe");
capabilities = DesiredCapabilities.firefox(); capabilities.setCapability("moz:firefoxOptions", options);
driver = new RemoteWebDriver(new URL("http://" + hubHost + ":4567/wd/hub"), capabilities);
FF opens up but it does not go to the URL I specify. If I comment out options.addArguments("-profile", profileDir); , it works ok, but with a new profile every time that does not have flash installed which is installed on the profile I have previously created.
Try setting:
FirefoxProfile profile = new ProfilesIni().getProfile("your-profile-name-here");
FirefoxOptions options = new FirefoxOptions().setProfile(profile);
WebDriver driver = new RemoteWebDriver(url, options);
Setting the profile via the command line like that is unlikely to work, just because of the way that geckodriver and selenium start sessions.