Download selenium jar and setup selenium in eclipse

Download Selenium Jar

You can download selenium jar files from official website of selenium. Selenium not need to install in system but you will get bunch of jar files which you can configure in eclipse. Below given steps will show you how to download selenium.
download selenium jar
  • Click on download of java jar files as shown in above image.
  • It will download .zip folder as shown in below given image.
selenium java jar files zip folder
  • Unzip folder. You will get .jar files and lib folder with few more .jar files in unzipped folder.
selenium jar files

Setup selenium project in eclipse

Once you have selenium .jar files, You can configure eclipse to setup selenium project as below.

Create java project in eclipse

  • Start eclipse.
  • Go to File menu -> Select New -> Java Project. It will open dialog to create new java project.
Create new java project
  • Set project name = Sample Project, Click on Finish button.
create a java project
  • New project with name Sample Project will be added in eclipse as shown in below given image.
project added in eclipse

Create package under project

  • Right click on project folder.
  • Select New -> Package.
  • Set package name = testPackage and click on Finish button.
save package
  • New package testPackage will be added under src folder of project as shown in below given image.
new package added

Add class file

Now you can add class file under new added package.

  • Right click on package.
  • Select New -> Class
new class added
  • New dialog to set class file name will be displayed.
  • Set name = SampleTest and select public static void main(String[] args) checkbox.
class file added
  • Click on Finish button. It will add new class file under package folder as shown in below given image.
adding class file in java

Add selenium jar files in new added project

Now you need to add selenium jar files in selenium project.
  • Right click on project file.
  • Select properties.
set project properties
  • It will open project properties dialog.
select java build path
  • Go to Java Bild Path option and select Libraries tab.
  • Click on Add External JARs button.
  • It will open file selection dialog to select jar files.
  • Go to selenium jar folder(unzipped) and select all jar files and click Open button.
select selenium jar files
  • Again click on Add External JARs button.
  • Go to lib folder -> select all jar files and click Open button.
select selenium jar files from bin
  • All the selenium jars will be added in project's build path.
selenium jars added in project's build path
Now you are all set to write your first selenium test script.

No comments:

Post a Comment