WebDriver Setup and Installation

In This Tutorial, we would be discussing about the installation procedure of Automation Tool Selenium webdrive

To be able to use WebDriver for run test cases, there are some prerequisites that need to be in place like the basic environment setup as follows.

Step 1:First Install Java on your machine from here and it will be open below page and download JDK.

Screenshot

Next page looks like below..

Screenshotone

Step 2:Install Eclipse IDE from here..

Firefox_Screenshot_2017-03-21T06-43-59.921Z

Step 3 – Download the Selenium Java Client Driver from here..

Screenshotj

After downloading you will get a folder which should contain two jar files related to selenium, a lib folder which also contains jar files inside it.

sshott

Step 4 – Configure Eclipse IDE with WebDriver

  • Open the “eclipse.exe” file inside the “eclipse” folder that we extracted.
  • Select Workspace as you want and click OK button.

Screenshot from 2017-03-21 12:25:59

Now in Eclipse create a new project and for creating click on File menu –> New –> Java Project -> Name the project as you wish and click finish.021316_1152_SeleniumIns1

Right-click on the newly created project and select new option and select package option and give you name wish.

A pop-up window will open to name the package,Enter the name of the package and click finish button.

Create a new Java class under newpackage by right-clicking on it and then selecting- New > Class, and then name it as “MyClass”. Your Eclipse IDE should look like the image below.

021316_1152_SeleniumIns5

Next Image Below and give class name and select the checkbox for ‘public static void main (String[] args) and click finish.

kkkk

On clicking ‘Finish’ in ‘Java Class’ wizard, your Eclipse IDE should look like the image below.

4555

Now selenium WebDriver’s into Java Build Path

In this step,

  1. Right-click on “newproject” and select Properties.
  2. On the Properties dialog, click on “Java Build Path”.
  3. Click on the Libraries tab, and then
  4. Click on “Add External JARs..”

hhahah

 

Browse all jar file that located in downloaded lib folder.

999

Select all folder and click on ok button.

5656556

So you can see all jar file display in Referenced Libraries folder.

This is the complete webdriver setup so you can run your test cases now.One sample code is below for your references.

777777

Click on run button so open page in Firefox.

 

 

 

 

 

 

 

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