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.
Right-click on the desktop shortcut and select Properties. Enter -P “profile-name” at the end of the Target box. Click the OK button. Double-click on the desktop shortcut to open Firefox with a specific profile.
--------------------------------- -------------------------- To get a 2nd Profile to launch while the first Profile is already running, you need to use the command line switch of '''-no -remote'''. That tells Firefox to ignore the already running '''firefox.exe''' process.
Firefox profiles include custom preferences that you would like to simulate an environment for your test script. For example, you might want to create a profile that sets preferences to handle the download popup programmatically during your test run.
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With