Thursday, 16 February 2012

Creating own Firefox profile and open Firefox with that profile using Class ProfilesIni and Class FirefoxProfile for selenium automation testing


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 dadabhagwan_LearnSeleniumWithJasmine {

public static void main(String[] args) throws InterruptedException {

ProfilesIni allProfiles = new ProfilesIni();
FirefoxProfile profile = allProfiles.getProfile("dadabhagwan_LearnSeleniumWithJasmine_FFprofile");

WebDriver driver = new FirefoxDriver(profile);

driver.get("http://satsang.dadabhagwan.org/");
System.out.println("Title is --  " +driver.getTitle());
System.out.println("Current URL -- "+ driver.getCurrentUrl());
System.out.println("Page source ---- ");
System.out.println(driver.getPageSource());

driver.quit();


}

}