SELENIUM WEBDRIVER

 


SELENIUM WEBDRIVER

In order to develop Selenium RC or WebDriver scripts, users have to ensure that

they have the initial configuration done. Setting up the environment involves the Following steps

  • Download and Install Java
  • Download and Configure Eclipse
  • Configure Firebug and Fire Path
  • Configure Selenium RC
  • Configure Selenium WebDriver

DOWNLOAD & INSTALL JAVA

We need to have JDK (Java Development Kit) installed in order to work with Selenium WebDriver/Selenium. Let us see how to download and install Java.

Step 1: Navigate to the URL: http://www.oracle.com

Step 2: Go to "Downloads" section and select "JDK Download".

Step 3: Select "Accept License Agreement" radio button.

Step 4: Select the appropriate installation. In this case, it is 'Windows 7-64' bit. Click the appropriate link and save the .exe file to your disk.

Step 5 : Run the downloaded exe file to launch the Installer wizard. Click 'Next' to continue.

Step 6 : Select the features and click 'Next'.

Step 7 : The installer is extracted and its progress is shown in the wizard.

Step 8 : The user can choose the install location and click 'Next'.

Step 9 : The installer installs the JDK and new files are copied across.

Step 10 : The Installer installs successfully and displays the same to the user.

Step 11 : To verify if the installation was successful, go to the command prompt and just type 'java' as a command. The output of the command is shown below.

If the Java installation is unsuccessful or if it had NOT been installed, it would throw an "unknown command" error.


DOWNLOAD & CONFIGURE ECLIPSE

Step 1 : Navigate to the URL: http://www.eclipse.org/downloads/ and download

Step 2 : Click the 'Download' button.

Step 3 : The download would be in a Zipped format. Unzip the contents.

Step 4 : Locate Eclipse.exe and double click on the file.

Step 5 : To configure the workspace, select the location where the development has to take place.

Step 6 : The Eclipse window opens


CONFIGURE SELENIUM WEBDRIVER

Now let us look at how to configure Selenium WebDriver. We will understand how to develop scripts with Selenium WebDriver in later chapters, however for now, we will understand just the configuration part of it.

Step 1 : Navigate to the selenium downloads section http://www.seleniumhq.org/download/ and download Selenium WebDriver

Step 2 : The downloaded file (selenium standloanserver) is in Zipped format and one has to unzip the contents to map it to the project folder.

Step 3 :

  •  Click on project go to build path
  • Select configure build path
  • go to library 
  • click on add external jars 
  •  select unzipped file and 
  • click on apply and close button