1) My Firefox is installed on following path C:\Program Files\Mozilla Firefox\firefox.exe
2) I'm using Windows 7 64 bit version.
3) I'm using Firefox 46.0 version.
4) I'm using selenium-java-2.53.0 version.
5) Firefox profile is located on C:\Users\xxxxxx\automation
I created separate profile and tried to use same in code but still web driver is creating in anonymous temporary profile only. Please help me on this issue.
I have done these ways.
First Method
ProfilesIni profile = new ProfilesIni(); FirefoxProfile myprofile = profile.getProfile("automation");
DesiredCapabilities capability = DesiredCapabilities.firefox(); capability.setCapability(FirefoxDriver.PROFILE, myprofile);
driver = new FirefoxDriver(capability);
Second method
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile("automation");
driver = new FirefoxDriver(myprofile);
Third Method
FirefoxProfile myprofile =profile.getProfile("C:\\Users\\xxxx\\NewProfile");driver = new FirefoxDriver(myprofile);
Fourth Method
FirefoxProfile myprofile=new FirefoxProfile(new File("C:\\Users\\xxxxx\\NewProfile"));driver = new FirefoxDriver(myprofile);
Note: When I'm executing following command 'C:\Program Files\Mozilla Firefox\firefox.exe" -p' its showing 2 profile is available first is default
and another one is I created for Automation in the name of automation
and able to launch manually without any issues.
But when automation runs i executed "about:support" in firefox address bar and reviewed the profile folder its showing anonymous temporary profile only.