How Selenium webdriver use existing firefox profile ?

by Selenium Trainer

in Blog, SELENIUM WEB DRIVER, Version1

Open firefox based on firefox profile using FirefoxProfile class Open firefox based on firefox profile using FirefoxProfile class


  • Create object of Class ProfilesIni
  • Call Method getProfile of Class ProfilesIni
  • Which return a object of the type Class FirefoxProfile
  • So Create new Class FirefoxProfile object and assign to it.


FF profile How it works

[sourcecode language="java"]
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 testFirefoxProfile {
public static void main(String[] args) {

//Class ProfilesIni details ->
ProfilesIni allProfiles = new ProfilesIni();

//Class FirefoxProfile ->
// Use FirefoxProfile Constructor
FirefoxProfile myProfile = allProfiles.getProfile("MyTestProfile");

WebDriver myDriver = new FirefoxDriver(myProfile);


System.out.println("What is my URL —————>" + myDriver.getCurrentUrl());

System.out.println("What is my Page title ———–>" + myDriver.getTitle());





Previous post:

Next post: