In last section, we have understood the brief details about Selenium and its components. Now we will discuss on selenium installation.
First thing you need to remember, Selenium is not a software which need to be installed in your system.
You need to download Selenium Jar file and import in your code to support the functions and APIs of the selenium code.
Before downloading and adding Selenium jar to your code, you need an IDE to write your test script. Here we will use Eclipse IDE which is open source. To check how to download and install the Eclipse, please click this link and come back this section.
Hope, now you are clear on the Eclipse IDE and how to create and run java code.
As you know earlier, you need a scripting language to write our Selenium test script. You can use Java, Python, C#, Ruby etc. But here concentrate on the Selenium with Java.
Let’s discuss on the installation of Selenium step by step.
Step 1: Download the Selenium java Client Server
Go to http://seleniumhq.org/download/ to download the Selenium Java Client server. Here you will find the client server for other language also. But you need to click on the download link of the java server. Check the screenshot below.
This will be downloaded as zip file. Save this in your local system extract this zip file and name this folder as selenium. You can give any name you want. But for easy convenience keep this simple.
This zip file which you downloaded contains all the jar file to be imported to the eclipse to support the selenium functions and APIs.
Step 2: Import all the Selenium jar to Eclipse.
Create a java project in Eclipse. Click on <Project name> and select properties
- Open the properties, then click on “Java Build Path”
- Click on the Library
- Click on the Add External Jar.
Once you click on the “Add External Jar”, a window popup will be shown and asked to import the Selenium jar . Go to Selenium jar folder that you have downloaded, and import all the jar to here.
Once you imported all the jar presented in the selenium client server folder click on “Apply and Close” as shown below.
That’s it. Now you are done with Selenium installation into Eclipse. You can now write Selenium test script and run.