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.
Next page looks like below..
Step 2:Install Eclipse IDE from here..
Step 3 – Download the Selenium Java Client Driver from here..
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.
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.
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.
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.
Next Image Below and give class name and select the checkbox for ‘public static void main (String args) and click finish.
On clicking ‘Finish’ in ‘Java Class’ wizard, your Eclipse IDE should look like the image below.
Now selenium WebDriver’s into Java Build Path
In this step,
- Right-click on “newproject” and select Properties.
- On the Properties dialog, click on “Java Build Path”.
- Click on the Libraries tab, and then
- Click on “Add External JARs..”
Browse all jar file that located in downloaded lib folder.
Select all folder and click on ok button.
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.
Click on run button so open page in Firefox.