Please Download Word Format User guide from this link Selenium Web Driver and J-Unit4 User Guide
Setting up IDE:
Installing Fire Fox Add-ons:
- First download Mozilla Firefox browser.
- Click on the Firefox tab present at the top the browser window.
- In drop down menu click on Add-on.
- Go to add on page of Mozilla Firefox browser. In the search box of Add on page search the term “Selenium IDE” and press enter
- A page will open which displays Selenium IDE add-on.
- Click on install next to the Selenium IDE add-on
- Once installation is done the Mozilla Firefox browser will ask you to restart the browser.
- Open Tools Menu in Fire Fox Web Browser.
- Verify Presence of “Selenium IDE”.
Downloading and Installing JDK and JRE:
- Download the latest version of the Java JDK from Sun Microsystems.
- Double-click on the install file and it should open an installer.
- Wait Until Installation Completes.
Setting Environment Variables for JVM:
- Open the properties of “My Computer” by either right-clicking the icon on the desktop or right-clicking Start > My Computer. When the pop up menu opens, scroll to the bottom and select “Properties”.
- This should open a window named “System Properties”. Click on the “Advanced” tab and then click “Environment Variables”
- Next, another window opens with a lot of confusing sentences and letters. Double-click on the “Path” variable on either of the option boxes. It is recommended to edit the variable in the box “User variables for (your username)
- Once the variable is opened, a text box in yet another window appears. Careful not to delete anything in this box. At the end of the text box, add a semi-colon if there is not one already, and add “C:\Program Files\Java\jdk1.6.0\bin” to the text box. This is assuming you did not change the file path of the installation.
- Click “Apply” and “OK” to all the windows you have just opened. Open the command prompt again, “java” command works then Environment Variable are correctly Set.
Downloading and Installing Eclipse:
- Go to the Eclipse Downloads website , and the following webpage will open up.
- Choose the appropriate version of Eclipse IDE for your operating system and Java installation.
- Look for “Eclipse IDE for Java Developers” and on its right hand side, there are two versions of Eclipse available (32 bit and 64 bit).
- If you have 32 bit version of Java, choose 32 bit version of Eclipse and if your using 64-bit Java, choose 64 bit version of Eclipse IDE
- If not sure about the configuration of your operating system, choose the 32 bit version of Eclipse IDE as it works on both 32 bit operating system and 64 bit operating system
- Note: – It is important to choose the same version of Eclipse and Java because if you mix 32/64 bit Java/Eclipse then Eclipse might not work.
- Once the right version selected, you will be directed to the mirror selection page:
- Proceed with the download by clicking on the Green arrow pointing downward.
- The download of eclipse-java-indigo-SR1-win32.zip will begin.
- Note: – Save the file to a convenient location like C:/ drive or Desktop.
- When the download finishes, proceed to the step 4.
- Unzip the file: – The downloaded file will be a zipped folder, so in order to access its contents we need to unzip the file as follows:-
- Find the eclipse-java-indigo-SR1-win32.zip from where you saved it.
- Double click on it.
- The file will open with the default extraction wizard(i.e WinZip or WinRAR)
- Once the extraction/Unzipping is complete, you will be able to see a folder named “eclipse”.
- Eclipse does not have any installer, that’s why we need to Run “eclipse”, an application within the eclipse folder as follows:-
- Double Click on the eclipse folder.
- In the eclipse folder, look for an application named “eclipse”; it has a round purple icon with white horizontal lines.
- Double click on it to run eclipse.
Downloading Selenium Web Driver J-Unit Bindings:
- Download Selenium Client & Web Driver Language Bindings from Selenium website.
- Extract downloaded ZIP file to intended location (keep some permanent one, as you will need them for a long time)
Using Web driver Bindings in J-Unit Project:
- Create new Java project in Eclipse
- Add all extracted JARs (also these in lib folder) to Java Build Path in project Properties
Recording Test Script in IDE:
- Open new tab in Mozilla Firefox browser.
- Open selenium IDE.
- Click on “Record” button. (Please note here. It will start recording all navigation and action once you click on “Record” button.
- Now enter URL “https://www.google.co.in/” in your browser. (Selenium IDE will record that action. Make sure your recording is working fine.)
- Click on “Images” link displayed in main menu.
- Click on “Maps” link displayed in main menu.
- Click on “Play” link displayed in main menu.
- Stop Selenium IDE recording by clicking on “Stop Record” button. Your recording is completed now.
- My script will looks like bellow in selenium IDE.
|clickAndWait||css=#gb_2 > span.gbts|
|clickAndWait||css=#gb_8 > span.gbts|
|clickAndWait||css=#gb_78 > span.gbts|
Exporting IDE Test Script in Web Driver J-Unit:
- After Recording Test case successfully. Open File From Menu.
- And Export Test Case AS “Java/J Unit/ Web driver” file.
Creating Test Project in Eclipse:
- Create new Java project in Eclipse
- Add all extracted JARs (also these in lib folder) to Java Build Path in project Properties.
- Add the Exported Code from Selenium IDE in Eclipse Project.
- Click Run Button in mwnue.
Selenium Web Driver Command Set: