Home » Selenium » Installation Of Selenium Web driver in Eclipse.

Installation Of Selenium Web driver in Eclipse.


Software Required: Eclipse Juno, Java 32/64 bit depends on your PC configuration, Selenium Java APIs, Selenium Browsers Drivers, Selenium Server Standalone API.

Installation of Eclipse with Selenium Web driver Test NG.

  • First Install Java with respect your OS configuration. For 64 Bit OS install 64 bit latest JDK , and for 32 bit OS install latest 32 bit JDK.
  • After Installing JDK set “JAVA_HOME” environment variable and set value in “path” variable also.
    JAVA_HOME=C:\Program Files\Java\jdk1.7.0
    Path=C:\Program Files\Java\jdk1.7.0\bin
  • Now install latest eclipse Juno with respect OS configuration and Java Configuration.Note: Make sure you create separate “WorkOnTheSelenium”  folder in one of the  Drive  and Extract eclipse there.
  • Now create shortcut of eclipse on desktop and open the eclipse , Now while opening eclipse it ask for workspace. So create your workspace in Work folder as “SeleniumWorkspace”.
  • Now after giving workspace your eclipse will open. Now you are set with eclipse.
  • Now create one java project, File- > New- > Java Project. Give some appropriate name for project , for sample project I am giving “TestProject”.  Now your java project is created.
  • Now create one package, Right click on project then New- > Package. Here also give some appropriate package name, for sample , I am giving “Testpackage”.
  • Now right click on package and  New- > Class. Give appropriate name for class as well. I am giving “Testclass”.
  • Now you are set with Project -> Package – > Class.
  • Now right click on Project folder and Build Path -> Configure Build Path – > Libraries .
  • Now click on Add External Jars to add selenium webdriver jars or libraries.  And select each and every jars from respective jar folder.
  • Now selenium jars are configured with project. Now go to project to write code.
  • To check selenium is working fine just place below code in Main function and run it.

    WebDriver seldriver;
    seldriver = new FirefoxDriver();
    seldriver.get(“YOUR URL PATH”);

    after placing this code you will see some errors as libraries are not imported.  Just mouse over where errors are showing and include those libraries which eclipse is suggesting.
    (Make sure while including libraries for errors , those libraries are belong to selenium only like

          import org.openqa.selenium.WebDriver;

          import org.openqa.selenium.firefox.FirefoxDriver;)

    Now just run the  project and check whether google is opening. Now explore more on Selenium Web driver with Java  TesNG , Happy Exploration.

Advertisements

3 thoughts on “Installation Of Selenium Web driver in Eclipse.

  1. Pingback: Behind the Code, Development and Testing: An Inside Look at Quality Assurance « Webonise Lab

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s