If you are a beginner I would strongly suggest you start your Selenium journey here Beginners, start here.
Selenium supports various programming languages like Java, Python, C#, Perl, Ruby, etc. Java & Python are one of the most widely used languages for Selenium.
Let us start with some installations
If Java is already installed in your system, you may skip this section.
How would I get to know if Java is already installed in my system?
Open Command Prompt or Terminal. Type java -version and press Enter. If Java is pre-installed it will display you the Java version.
Let’s follow these steps to download and install Java-
- Go to the Java Downloads Page
- Click on the option for Java Platform (JDK)
- In the next page select the Accept License Agreement radio button, if you accept it and click the download link against your matching system
- Wait for the download to get completed
- Run the installer once the download is over and follow onscreen instructions
- You are almost done
Almost done? I thought installing Java is completely over.
Not yet dude. We need to add Java to our system’s PATH.
Let’s do that –
- Go to Start and search for ‘System’.
- Click on ‘System’
- Click on ‘Advanced system settings’
- Click on ‘Environment Variables’ under the ‘Advanced’ tab –
- Under ‘System variables’ click on ‘New’ button –
- Enter the variable name as ‘JAVA_HOME’ the and the full path to Java installation directory as per your system –
- Now on the ‘Environment Variables’ window, under ‘System Variables’ select ‘Path’ and click on ‘Edit’ button
- Under ‘Variable value’, at the end of the line, after the semicolon, enter the following
Click OK and you are done
Hold on… How would I be sure Java is correctly configured?
Good question. Just run following command in cmd –
It should display the installed version.
Hey, wait… How to check if python is already installed on my computer?
Good question. Most Mac ships with python 2.7 already installed. To confirm, open Command Prompt / Terminal and run following command –
If it shows you a version, Python is already installed.
So if python is already installed on my system I don’t need to do this installation again?
I know you are a lazy ass. We are using Python 3.6.1 for this tutorial. There are lots of changes Python 3 has introduced over Python 2. Python 2.x is legacy, Python 3.x is the present and future of the language. So if you have Python 3.3 + installed on your System you are good to go, otherwise please continue with the installation.
Hold on. If an older version Python is already installed on my system should I uninstall it first and then install the new version?
Technically yes. You may have multiple versions of Python on your system. The version that is configured in PATH would be invoked by typing directly in cmd/terminal. Alternatively, you can go with a full python path. e.g C:\python36\python.exe
To avoid any confusion I would suggest to uninstall the older version and then go with the newer installation.
Let’s start installing python:
- Open the browser and navigate to Python downloads page
- Click on Download Python 3.x button. As of today, the latest available download is 3.6.1
- Run the installer. Select the checkbox for “Add Python 3.6 to PATH”.
- Follow on-screen instructions.
- Once python is installed please make sure it is configured in PATH. Run command “python -V” and check if the console is displaying installed python version. If you see something like – “python is not recognized as an internal or external command”, you would need to configure environment variables.
- If you are on Windows, run following command in cmd (Please pay attention to your installation directory path)
type path %path%;C:\python-installation-path\python36
In Mac OS, it is the installer that handles the path details.
Let us now setup eclipse in our system.
Eclipse IDE??? What is that and why do I need it in Selenium?
Well if you remember the very First Tutorial, we need to write code in one of our favourite programming languages for Selenium WebDriver. There are several IDEs (or Editors) available for Java & Python. We will be using the most widely used one, Eclipse IDE.
Steps to install Eclipse IDE
- Navigate to the following URL – https://www.eclipse.org/downloads/
- Click on Download button
- Once the download is over and runs the program
- Install the program and follow on-screen instructions
- Once the installation is complete, launch Eclipse.
[Python Only] Installing PyDev plugin for Eclipse
If we need to write and run Python code on Eclipse we need to extend its capabilities by installing a plugin called PyDev.
PyDev requires Java 8 and Eclipse 4.6 (Neon) in order to run. Please make sure you have Java 8+ and Eclipse 4.6+ (Neon or above) installed in your system before continuing with PyDev installation.
- From Eclipse’s top menu-bar select Help > Install New Software
- In the next screen, under the field ‘Work with’ click on “Add” button.
- Enter the following details – Name: PyDev, Location: http://www.pydev.org/updates. Click OK.
- Select the checkbox for “PyDev for Eclipse” and click Next.
- You may read the license agreement and if you accept, as if you won’t :), click the Accept radio button and click Finish.
- Eclipse should start downloading the plugin and prompt you to restart Eclipse. Just say it yes and let Eclipse configure PyDev for you.
We are done with these setups. In the Next Tutorial, we will install some Selenium dependencies so that we can write and run our first Selenium script.
5 thoughts on “System Setup | Installing programming language dependencies”
Hi Shadab , these tips are really helpful, please let me know Will this work on mozila browsers on tablets???
Kishore, it will work on tablet as well. However the setup process might be different for Non wondows OS. I would suggest start in windows OS. Lateron I'll cover how to run tests on android or iOS phones/ tablets