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.
- Go to official website of selenium download page.
- Click on download of java jar files as shown in above image.
- It will download .zip folder as shown in below given image.
- Unzip folder. You will get .jar files and lib folder with few more .jar files in unzipped folder.
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.
- Set project name = Sample Project, Click on Finish button.
- New project with name Sample Project will be added in eclipse as shown in below given image.
Create package under project
- Right click on project folder.
- Select New -> Package.
- Set package name = testPackage and click on Finish button.
- New package testPackage will be added under src folder of project as shown in below given image.
Add class file
Now you can add class file under new added package.
- Right click on package.
- Select New -> Class
- New dialog to set class file name will be displayed.
- Set name = SampleTest and select public static void main(String[] args) checkbox.
- Click on Finish button. It will add new class file under package folder as shown in below given image.
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.
- It will open project properties dialog.
- 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.
- Again click on Add External JARs button.
- Go to lib folder -> select all jar files and click Open button.
- All the selenium jars will be added in project's build path.
Now you are all set to write your first selenium test script.
No comments:
Post a Comment