Tutorial1_ConfigureJavaWebDriverInEclipse
Tutorial1_ConfigureJavaWebDriverInEclipse
Welcome to the Selenium-Java series. This is the first tutorial in this series. In this tutorial we are going
to study about selenium-webdriver overview plus how to download and configure selenium-java jars in
eclipse from scratch!!
1. Selenium WebDriver is a browser automation framework that accepts commands and sends
them to a browser. It is implemented through a browser-specific (chrome, Mozilla, IE) driver. It
controls the browser by directly communicating with it. Selenium WebDriver supports Java, C#,
PHP, Python, Perl, Ruby.
3. Browser Support – Mozilla Firefox, Internet Explorer, Google Chrome, Safari, Opera, Android,
iOS, HtmlUnit
Figure 2
The below page comes up. On the left hand panel, search for WebDriver. Since WebDriver is an
interface, it is seen in italics. As can be seen on the right hand panel, all the web browers (example,
chrome driver etc) implement this interface. We will study more about this interface in further
tutorials.
Figure 3
Limitations of WebDriver:
WebDriver Cannot Readily Support New Browsers. Remember that WebDriver operates on the OS
level. Also, remember that different browsers communicate with the OS in different ways. If a new
browser comes out, it may have a different process of communicating with the OS as compared to
other browsers. So, you have to give the WebDriver team quite some time to figure that new
process out before they can implement it on the next WebDriver release. However, it is up to the
WebDriver's team of developers to decide if they should support the new browser or not.
Figure 4
Enter java project name
Figure 5
Next, you see that, DAY1 project would be created that will contain src folder
Figure 6
Click ‘Properties’ >click ‘Java Build Path’ >click ‘Libraries’ tab. You will see that java libraries are already
added, see below
Figure 8
The below window comes up. Expand ‘Java’ & select ‘Class’, see below
Figure 10
Click ‘Next’, below window comes up. Enter class name ‘Demo’ & select the checkbox
‘public static void main(String[] args)
Figure 11
Click Finish. Write the print statement System.out.println("Welcome!"); as seen below
Figure 12
Right click on the program > Run As > Java Application, see below
Figure 13
Figure 14
Figure 16
Go inside selenium-java-3.141.59 folder. You will see few jars outside ‘libs’ folder
Figure 17
Go inside ‘libs’ folder. You will see few jars inside ‘libs’ folder
Figure 18
Go to java build path (Right click on DAY1 project >Click ‘Properties’ >click ‘Java Build Path’ >click
‘Libraries’ tab)
Figure 19
Click ‘Add External jars’, the below window comes up. Browse to the location in your machine where
you have downloaded the selenium jars, see below. Select all the jars outside ‘libs’ folder
Figure 20
Click ‘Open’. The jars should be seen as added in the ‘Java Build Path’ like seen below
Figure 21
Click ‘Add External jars’. Select all the jars inside ‘libs’ folder like seen below
Figure 22
Click ‘Open’. So we should see all the jars added in the ‘Java Build Path’ like seen below (7 jars in this
case)
Figure 23
Click ‘Apply and close’. So we have now made a connection between selenium & java project
In the next tutorial, we would study about how to inspect elements in various web browsers. Thank you
for reading!!!