Configure Eclipse with Selenium WebDriver

Now that you have downloaded Java, Eclipse and Selenium Webdriver – let’s see how to configure Eclipse with Selenium WebDriver. Basically what we need to do is…

Configure Eclipse with Selenium WebDriver

Create a workspace in Eclipse

Create a New Project

Create a New Package

Create a New Class

Add external libraries to the project

Create a workspace in Eclipse

Launch Eclipse (eclipse.exe).

2. When you launch eclipse the first time – you will notice a popup asking you to select a directory as a workspace. When you develop Java applications in Eclipse, it stores all the created files in a directory called “workspace“. It’s nothing but a folder where all your eclipse data (including code) will be stored.

3. You can just use the default location or specify your preferred location.

4. Eclipse launched successfully

Create a new Project

Now that you’ve got Eclipse up and running, it’s time to create your first Java project. Hope you know what a project is? No? The next logical unit within workspace. A single workspace can have multiple projects. You can think of project as different automation assignments – a set of related code.

1. Select File > New > JavaProject

2. Enter a Project Name. Here we have given ‘SeleniumTutorial’ as the project name. As you can see, the Java environment to be used for this project is selected by default under JRE section.

3. Click Finish and your first project is ready for experiments 🙂

Create a new Package

1. Select your project. Select File >> New >> Package

2. Enter the package name (e.g. automationPackage) >> Finish

3. A new package ‘automationPackage’ is now created under the project ‘SeleniumTutorial’

Create a new Class

Now it’s time to get started. Let’s create a class within the newly created package.

Related Articles

What are the pre-requisites to writing automation scripts in Selenium? Obviously, you need the tools first. Additionally you need to finalize the programming language you will be using to write test scripts and install the associated IDE. As ‘Java’ is the most popular & widely used programming language across the world (both for development & automation testing) – we will be focusing on writing scripts in Java using Selenium. For that first you need to have the ‘Java Development Kit’, Eclipse IDE and Selenium WebDriver. Let’s start with installing ‘Java Development Kit’, popularly known as JDK.

Eclipse is the most widely used Java IDE in the programming world. It contains a base workspace and an extensible plug-in system for customizing the environment. Eclipse itself is written mostly in Java and its primary use is for developing Java applications, but it may also be used to develop applications in other programming languages through the use of plugins. Continuing on our zeal to learn automation via Selenium, let’s learn how to download and start Eclipse IDE.

About STS

Software Testing Studio is an attempt to share some incredible knowledge from industry leaders & experts, which should be helpful for anybody to start his/her career in ‘Software Testing’ or to progress it further. Apart from the technical nitty-gritties, one can also find some intellectual posts by industry experts sharing their Wisdom.