Reputation: 61
When I use default profile starts without problem. But when i starts with custom profile, firefox starts but stays "blocked". The process remains active consuming 31MB of RAM, but never start. Only start if I killed the process, then starts and works fine with selenium.
I use Windows 7, Firefox 25.0.1 and selenium-server-standalone-2.38.0.jar ¿Maybe problems with compatibility of versions?
This is the code to open the profile:
FirefoxProfile profile = new FirefoxProfile(new File("C:/Users/UserTest/AppData/Roaming/Mozilla/Firefox/Profiles/tydtn9km.testprofile"));
WebDriver driver = new FirefoxDriver(profile);
Edit: This is my actual code
package org.openqa.selenium.example;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
public class Main {
public static void main(String[] args) {
ProfilesIni profile = new ProfilesIni();
FirefoxProfile ffprofile = profile.getProfile("Other");
WebDriver driver = new FirefoxDriver(ffprofile);
driver.get("http://google.com");
}
}
Edit 2: Resolved The problem ocurred because my Firefox profile is located in another partition, and Firefox in the other partition.
Upvotes: 6
Views: 14806
Reputation: 14748
I have been using it like this:
First, create a Firefox profile and name it somehow you know. E.g. SELENIUM
Then initialize your profile:
ProfilesIni profile = new ProfilesIni();
FirefoxProfile ffprofile = profile.getProfile("SELENIUM");
WebDriver driver = new FirefoxDriver(ffprofile);
Upvotes: 5