Thursday, 9 August 2018

Selenium WebDriver Configuration Step by Step

WebDriver Configuration
===================

Step 1: Download "JDK 1.8" and Install (Based on your machine 32bit/64bit)
Step 2: Specify "JDK and JDK/bin" path into system Environment variables
Go to "C:\Program Files\Java\jdk1.8.0_181"
  "Copy" the above path
    "Right click" on "PC Properties"
      Click on "Advanced System Settings"
        Click on "Environment Variables"
          Click "New" under System Variables
             Variable Name: JAVA_HOME
               Variable Value:  Paste the copied above "C:\Program Files\Java\jdk1.8.0_181"
                 Click on "OK" Button
Go to "System Variables" secton on the same screen
Find "Path" and Click on "Edit"
    Under variable value: do not delete or replace anything, go to the end of the value and
      enter "semicolon" (;), then copy and paste bin path as "C:\Programfiles\Java\jdk1.8.0_181\bin"
then click "OK" Button then click "OK" Button Again

NOTE:  The above process is to let the machine know where the Java Library is available while executing the test scrips


Step 3: Download "Eclipse Mars 2" (Based on your machine 32bit/64bit)
Right click and Extract "Eclipse zip" file from "Downloads" folder
  Open Extracted "Eclipse folder"
    Select "Eclipse Icon" (3rd one from the bottom)
      "Right click" on "Eclipse Icon"
Click on "Send to"
          Select "Desktop (create shortcut)" option
            Eclipse is now ready to use from the Desktop


Step 4: Create "Java Project" in Eclipse
Open "Eclipse" from Desktop
  Provide "Workspace name" (exp: C:\Users\Prasad\Desktop\Selenium\Selenium Workspace)
    Click on "OK"
       Click on "Workbench" from top right corner on Eclipse
Click on "File" from Main Menu
           Hover on "New" and Select "Project"
             Select "Java Project" (the first one)
               Click on "Next" button
Provide a "Project Name" (exp:  "SampleProject01")
                  Click on "Finish" button
                    Click "Yes" on the next window
                       "SampleProject01" is successfully created on Eclipse


Step 5: Download WebDriver 2.53.1 jars (Based on your machine 32bit/64bit)
Right click and Extract "selenium-java-2.53.1" zip file  from "Downloads" folder
  Open "selenium 2.53.1" folder
    Select "selenium-java-2.53.1" and "selenium-java-2.53.1.src" jar files and move them into "libs" folder above
       Now we have all the "jar files" in one folder called "libs"

Step 6: Configure WebDriver jar files to Java project in Eclipse
Go to Eclipse Application
  Select "Java project" that was created previously "SampleProject01"
    Right click on "SampleProject01"
      Hover on "Build path"
Select "configure Build path"
         Click on "Libraries" Tab
           Click on "Add External jars"
             Browse WD jar files location
I kept all my selenium files and softwares in one folder on Desktop,
               In your case it may be "Downloads folder"
                 (MyCase: C:\Users\Prasad\Desktop\Selenium\selenium-java-2.53.1\libs)
                   Select "All jar files" using (Ctrl+A)
Click on "Open"
                     Click on "Apply"
                       Click on "OK"

You will notice jar files are associated to "SampleProject01" as "Referenced Libraries"

Now We Have Successfully Configured WebDriver To Automate Software Testing
===========================================================

No comments:

Post a Comment