Monday 17 November 2014

Profiling In Firefox

Concept Of Firefox Profile:
The only browser Firefox which supports profiling feature.If a user wants to customize the settings, Firefox can customize it by using Firefox profile.This profiling feature is not there in Chrome & IE. The key feature is every profile would have its own settings added and you can create as many profile as you can.

How To Create Profile?
1.Close the Firefox from File -> Exit menu


2.Go to run -> type firefox.exe -p Profilemanager -> OK


3.Create Profile -> Next


4.Enter the new Profile name -> Finish [Then this particular file will be created]


5.Select that new profile -> click on Start Firefox button, it will open a fresh Firefox which will not have any settings, bookmarks saved/added earlier for the default profile. Here, for this new profile you can customize your settings, bookmarks and all.


How To Open Profile?
  1. If you want to open some other profile or to want to go back to the default one, then you need to close the Firefox browser from File -> Exit menu.
  2. Go to run -> type firefox.exe -p Profilemanager -> OK
  3. Then you can open the profile you want to browse.
Firefox Profiling In Selenium:
Whenever Selenium starts Firefox, it will create its own profile when you start it and then that profile gets automatically destroyed when program terminates.

When we want to use the existing profile instead to open new profile under some circumstances, below is syntax to open any existing profile user wants to open through Selenium:
These 2 classes are used - ProfileIni, FireffoxProfile 
//ProfileIni, FireffoxProfile
ProfilesIni profile = new ProfilesIni();
FirefoxProfile p = profile.getProfile("profile_name");
FirefoxDriver driver = new FirefoxDriver(p);

Establishing Proxy In Firefox Profile:
Proxy- Proxy behaves as an intermediate between user and server.If you want a request to be sent through proxy server, then the machine needs to be connected with the proxy server.Proxy server validates the request whatever sent, assigns IP then sends the request to the requested site.

Here are the steps to establish proxy in Firefox profile -
  1. File -> Exit
  2. Go to run -> type firefox.exe -p Profilemanager -> OK
  3. Select Profile
  4. Set proxy server manually  Go to Tools -> Options -> Advanced -> Network -> Settings -> Proxy url in connection settings
  5. Then you can open this particular profile with Selenium with this proxy settings.