Install JDK
JDK stands for java development kit. Install any version that is 1.7 or higher.It is advisable to have JDK and NOT JRE. So lets pay close attention and ensure that our environment is pointing to JDK (which includes JRE)
Step 1
Download JDK7 from oracle website downloads page. I am using JDK7, however if you have version 8 , that is fine too.
Step 2
Accept license agreement
Step 3
Select the java version according to your operating system environment. In my case it is 64 bit windows. Download and save it. Double click and run the setup
Step 4
Follow the regular process of installation of any software on windows and go with defaults. In my case, it got installed to program files\jdk as below
Step 5
Now go ahead and create a environment variable JDK_HOME and point it to the installation directory. After that add %JDK_HOME%/bin to PATH variable
Step 6
Now open a command line and type “java -version”, it should show the version installed.
Install and Configure Maven
Step 1
Download maven from apache website
Step 2
Unzip on a local drive. I unzipped to c:\apache…
Step 3
Now set an environment variable M2_HOME=c:\apache… and append %M2_HOME%\bin to PATH variable. Once you do that, open a command line and type “mvn -version”. It should print something like the below [this will complain if it doesn’t find JDK]
Exceptions
If you are in a corporate/enterprise environment, then you might have to do extra steps like.
- %M2_HOME%/conf/settings.xml will be specific to your environment. This is so that connect to an internal maven repository and not necessarily maven central
- The conf might point to Nexus or like repositories, so you might have to configure that
- We are assuming here that you have access to maven central repository and all other dependent sites access.
Install and configure Eclipse
Step 1
Navigate to Eclipse downloads page and download the latest version. I have luna that is Eclipse IDE for Java Developers. Download 32 or 64 bit based on your machine type [You can see the machine type for windows in My computer – properties]
Step 2
Unzip the eclipse folder anywhere on your machine. In my case I have it under c:\softwares\eclipse-luna….\eclipse. See below. You can have it wherever on your machine [I would recommend NOT to put it in My Documents folder if you are in corporate environment because they back that folder up and you don’t want eclipse to be backed up]
Step 3
Now double click the eclipse.exe icon and it should open up eclipse. If you get any start up screens, go past them until you land up on workbench. It should look something like this [unless you already use eclipse and have customized it with themes and colors etc]
Step 4
Go ahead and check that eclipse is already configured with Maven by File – New – Project and you should find Maven section as below.
PLUGINS
Install the below two plugins from Eclipse Market place by navigating from help menu
- ANSI Escape in Console :This plugin is to get the colors for Cucumber when we execute and see the output in console. We will see why this is required in a later section.
- TestNG plugin: We are installing this just in case we need, however I haven’t used it so far.
- Cucumber Eclipse Plugin: This is really a savior for many folks to adopt Cucumber in the Java World. We know how awesome the Rubmine plugin for cucumber is. Similarly this plugin gives us the same experience and neatness that we require when writing code [with all nice colors;)]
Set up Selenium Webdriver Components
The below instructions are on a Windows machine, but *nix/mac should be similar.
1) Firefox Browser
Firefox browser DOES NOT require any extra Selenium webdriver components
2) Chrome Browser
a) Download chromedriver.exe from here. Get the latest version
b) Unzip chromedriver_win32.zip into C:\SeleniumWebdrivers (assuming you are using windows). The file chromedriver.exe should be present
c) Now add “C:\SeleniumWebdrivers folder to the Windows PATH variable. If you are using Windows 7, go to Control Panel -> Users -> Add/Change environment variables
d) Click ‘New’ under User variables section and do the below
e) Verify that chromedriver.exe can be started successfully
f) Hit CTRL+c and kill the process
3) Internet Explorer
a) Download IEDriverServer.exe from here. Get the latest version
b) Unzip IEDriverServer_Win32_2.44.0.zip [OR 64bit based on your machine] into C:\SeleniumWebdrivers (assuming you are using windows). The file IEDriverServer.exe should be present
c) Now add “C:\SeleniumWebdrivers folder to the Windows PATH variable. If you are using Windows 7, go to Control Panel -> Users -> Add/Change environment variables.
d) Click ‘New’ under User variables section and do the below
Note: Do c) and d) ONLY if you have NOT already done so in chromedriver.exe section above
e) Verify that IEDriverServer.exe can be started successfully
f) Hit CTRL+c and kill the process
No comments:
Post a Comment