Getting Started With Selenium : Part 1

Getting started with selenium is very easy.
First you need to have some basic requirement, before you start using selenium.
1.Your favourite programming language.
2.It's Programming IDE
3.Selenium library for language
4.Driver for the browser you want to use.

For this tutor I will be using Java,Eclipse and chrome driver.

#Download the JDK

Download the Java JDK from Oracle Site
Download the Jdk depending upon your OS.

#Download the Eclipse

Download Eclipse IDE for Java Developers  (download any latest version).

# Download the required library

For using using selenium,First you need to get the required library for this tutor we will download the standalone jar.

1. Navigate to URL : http://www.seleniumhq.org/
2.Click on Download tab

3.Now download the Selenium Standalone Server

4.Click on the link which shows the version. like 3.4.0, it will start download of .jar file.

#Download the driver

Now to run  selenium scripts on different browser you need to get their their respective driver. For now we will be using the chrome driver. If you want to use some other browser it can be downloaded from the selenium site.


To download the chrome driver navigate to section Third Party Drivers, Bindings, and Plugins of the site. Scroll down and click Google Chrome Driver link. It will redirect to chrome driver site.

Click the link which says : Latest Release: ChromeDriver 2.30

New page will open with the Download link : Latest Release: ChromeDriver 2.30

New page will open containing the drivers list, Download driver depending upon your OS.
It will start downloading of the driver.

#Setup Work Environment

Now we need to setup our work environment.
If you are using Eclipse open Eclipse.
1. Select your workspace.

2. Go to file new JavaProject


3.Now in project explorer in src right click and create a package like 'com'.

4.Now open your project path in windows explorer or Right Click project Show in -> System Explorer

5. My folder is "E:\seleTest\SeleniumTest"

6.Here create two folders lib and drivers.  These folders will store all the library and Browser drivers.
7. Copy the selenium driver selenium-server-standalone-3.4.0.jar (download earlier ) to lib folder.
8. Copy the chrome driver to drivers folder.
9 Now the the project should look some think like this.
10.Now right click the project and Navigate to build path ->Configure build path
11.Select library tab and click Add jars button

12. In the dialog box select the selenium library and click the ok button. Then Apply and Ok button


Now the environment is set. And we can write the first selenium script.

Comments

  1. Best blog have ever gone throw.. self explanatory and well pictorial. Thank you for helping beginners like me.

    ReplyDelete

Post a Comment