Beginning with Selenium 3.0 Automation – Part III (Setup your project and Configure build path)

Beginning with Selenium 3.0 Automation – Part III (Setup your project and Configure build path)

 

With your basic idea about Selenium, it is time to begin with the actual Selenium coding.

What do you need?

  1. Download and install the latest Java on your machine.

You need to have (Pre-requisites)

  • Java Development Kit (JDK)
  • Install it from

http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. Install Eclipse on your machine.

Java being the preferred language due to its simplicity and dynamic handling, it is advised to have Eclipse IDE.

You can install from

http://www.eclipse.org/downloads/

(Get the right Eclipse based on your machine 32 bit or 64 bit feature).

3. Download the Selenium Java Client Driver

  • Selenium Client Driver is needed for ensuring compatibility with different languages that we make use of.
  • It is available for different language formats like C#, Ruby, Python and Java.
  • You can download the Java Client Driver from

http://www.seleniumhq.org/download/

On visiting this link you will view the following. Pick the one appropriate for you.

Selenium Version
Selenium Version
  • Once you download the zip for the Client drivers, you can install into a folder which will be subsequently imported into Eclipse.

 

4. Configure your Eclipse IDE with the Selenium WebDriver.

How do you do it?

  • First, initiate or launch your Eclipse.
  • It will prompt you to identify and select your “Workspace”. Select the right folder and proceed.
  • Now create a Java Project by File >> New >> Java Project.
  • Enter a project name. Example “Project_Automation”.

5. Create a Project in Eclipse

Create a Project in Eclipse
Create a Project in Eclipse

 

 

 

  • The project is created by File >> New >> Java Project
Specifying a Project Name
Specifying a Project Name

 

 

 

 

 

 

 

 

 

What you will see?

On creating the project, you will see the following structure.

Your Selenium Project in Eclipse
Your Selenium Project in Eclipse

 

 

 

 

 

 

Expand it to see what it holds inside the project.

Expand your project to see what it contains...
Expand your project to see what it contains…

 

 

 

 

 

 

 

 

 

Expand and right click the “src” folder to create a new class.

Create your class under SRC folder
Create your class under SRC folder

 

 

 

 

 

Create your class
Create your class

 

 

 

 

 

 

 

 

 

At last, your class is created. Hope you have no problems until now.

Finally your class is created
Finally your class is created

 

 

 

 

 

6. Setting the BUILD PATH

  • Before we proceed with any coding under the class, you will need to set the build path.
  • Remember the Selenium Client Drivers you have downloaded and saved into a folder.
  • Now is the time to set the properties to those client driver files.
  • Right click the Project and select “Properties” option.
  • Select the sub-option “Java Build Path”
  • Click the “Libraries” tab.
  • Click the “Add External JARs” button and select all the Java Client driver files.

 

Configuring BUILD path
Configuring BUILD path

 

 

 

 

 

 

Configuring BUILD path
Configuring BUILD path

 

 

 

 

 

 

Once the reference is set and done, there you are…

Your build path is configured and done
Your build path is configured and done

 

 

 

 

 

 

 

 

On the build path being set, will reflect in the “Referenced Libraries” folder.

Reference Libraries updated accordingly.
Reference Libraries updated accordingly.

 

 

 

 

 

 

 

 

 

 

 

Next section will deal with the creation of the Selenium script…

 

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s