Creating First Web Automation Project


  1. Eclipse (Development Environment)
  2. Selenium Jars (Jars)
  3. Chrome driver/ Firefox driver


  • Launch the eclipse and create new Maven project
  • Add Group Id and Artifact Id and select Finish

  • Right click on the project name from the package explorer and add new class.

  • Right click on the project and select build Path –> Configure build path
  • Add the required jars for selenium or use maven repository and configure the .pom file
  • Provide the driver path in the property. Consider the chrome driver
  • System.setProperty("""/Users/username/Downloads/chromedriver")
  • Create an object for chromeDriver.
  • WebDriver driver = new ChromeDriver();
  • Launch the website using get method.
  • driver.get("");
  • Select the element and perform action.
  • driver.findElement("signIn")).sendKeys("");
  • Tap on the errors and import the respective classes from the jars.
  • Finally the Web automation code looks like:

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;


public class Test {

public static void main(String args[]) throws InterruptedException {

 System.setProperty("", "/Users/krishnachaitanya/Downloads/chromedriver");

// WebDriver driver = new FirefoxDriver();

WebDriver driver = new ChromeDriver();



driver.findElement(By.linkText("Sign Up")).click();






  • Execute/Run the class.
  • This will perform the following actions
    • launch the chrome browser
    • Open facebook page
    • Enter email and password
    • tap on log in button

Leave a Reply

Your email address will not be published. Required fields are marked *