Thursday, 19 September 2013

How to Work with Firefox Profile with Selenium WebDriver

Create Firefox Profile with Profile Manager:

Close all open instance of Firefox Browser( use file->Exit Option)

go to Run and type - firefox.exe -p

Create a New Profile with profile manager.

Open the Relevant Profile with WebDriver:


Before calling FirefoxDriver Constructor, we have to perform following steps-
 Create an object of ProfilesIni Class

ProfilesIni in = new ProfilesIni();

Create an object of Firefox profile

FirefoxProfile profile

Call a method getAllProfiles that is exist in ProfilesIni Class, which will return Firefox Profiles

profile = in.getProfile("Provide name of Firefox Profile you want to interact with");

Now simply Create object of Webdriver with FirefoxDriver Class Constructor

WebDriver driver = new FirefoxDriver(profile);

Wednesday, 18 September 2013

Open Internet Explorer and Chrome Browser Using Selenium Webdriver

To Open Internet Explorer Browser with Seelnium WebDriver, we have to perform following steps:


1:  Create a new instance of WebDriver Interface, WebDriver driver;

2: Download IEDriverServer from SeleniumHQ.

3:  System.setProperty( "webdriver.ie.driver", "path of IE server.exe");

/*
    In Case of InternetExplorer,we need to set path for IE server exe file with setProperty method. If you don't set this property you will get an Exception  stating- "The path to the driver executable must be set"
*/

4:  driver = new InternetExplorerDriver();


5:  driver.get("http://www.google.com");

Thursday, 15 August 2013

Virtual Box Set Up in Windows OS

We can Run Linux/Unix in our Windows System using Virtual box configuration in our Windows machine.
Here are the steps about how we can download Virtual Box:

                                 Download Virtual Box:


  • Go to the url https://www.virtualbox.org/wiki/Downloads for Virtual box download page.
  • Under the Virtual box binaries Heading,
  • There will be list of Virtual box for different OS with latest version.
  • Click on the link- Virtual box for windows OS.


                              Download Linux/Unix Flavor(Ubuntu in this case):




                               Installing Virtual Box:


  • Run the .exe of Virtual Box
  • Complete Installation.

                               Creating a Virtual Drive and RAM for New OS(Ubuntu):


  • Open Virtual Box.
  • Virtual Box Manager window will open.
  • Click on New icon from the navigation.
  • Create Virtual machine window will open, Provide a Name for your virtual OS and select type of OS(Linux)
  • From version drop down select the appropriate flavor(Ubuntu) and click on Next.Remember if you have 64 bit system then choose Ubuntu 64 option from the version dropdown.
  • Now it will ask for RAM size for this virtual OS, Give an appropriate size and click Next.
  • Select option for Create new virtual hard drive and Click Create.
  • Select VDI(VirtualBox Disk Image) option for hard driver type and click Next.
  • Select Dynamically allocated option and click Next.
  • Give hard drive name, Allocate size for hard driver and click on Create

                               Attach .iso file to Virtual Box to Get Started:


  • Go to VirtualBox Manager.
  • Virtual OS will appear in left side and will be default to Powered Off.
  • Click on Start icon from the navigation.
  • Select Start up disk window will get opened.
  • Select the .iso file we download for ubuntu and click on Start
  • If everything works fine, you will get a window opened for you newly Created OS.