Automation Script Implementation in Webdriver

Automation Script Implementation in Webdriver:

Let’s know, how to do Automation Script Implementation in Webdriver in Eclipse by using Java. Here in this article, I have implemented a Selenium Webdriver automation script of Practice form to fill for the purpose of Practice for Automation Testing.

In this script, I have taken Project Name: Selenium Automation, Package name: Practice, Classname: Webdriver_Practice

In this script I have used to automate Text boxes, dropdown, Multiple options select in List box, Button, Radio button, Checkbox, Image path for upload, parameterization, Google chrome browser launch etc.


package Practice.Practice;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;




public class Webdriver_Practice {               

                public WebDriver driver;


                public void Chrome_Launch() {

                           System.setProperty(“”, “D:\\Selenium\\Library\\chromedriver.exe”);

                           driver=new ChromeDriver();



                public void Url_0pen() {





              public void Practice_Automation_Form(){

 driver.findElement(By.partialLinkText(“Partial Link Test”)).click();  //click on Partial Link Test                                                               driver.findElement(By.xpath(“/html/body/div[1]/div[5]/div[2]/div/div/div[1]/div/div/div/div[2] /div/form/fieldset/div[8]/input”)).sendKeys(“Test”);  //Enter First Name

 driver.findElement(By.xpath(“/html/body/div[1]/div[5]/div[2]/div/div/div[1]/div/div/div/div[2] /div/form/fieldset/div[11]/input”)).sendKeys(“Name1”);   //Enter Last Name

 driver.findElement(“sex-0”)).click();  // Select the Sex as Male

 driver.findElement(“exp-3”)).click();  // Select the Years of Experience

 driver.findElement(“profession-0”)).click(); // click on check box of Profession as Manual Tester

 driver.findElement(“profession-1”)).click(); // click on check box of Profession as Automation Tester

 driver.findElement(“photo”)).sendKeys(“C:\\Users\\Public\\Pictures\\Sample Pictures\\test.jpg”); // This line of code will upload the Profile pic from the Local system drive

 new Select(driver.findElement(“continents”))).selectByVisibleText(“Australia”); // This line of code is for Select the value from a dropdown field.                     


 /*This below method is to select multiple options in a Listbox or dropdown  */        

  public void Select_Multiple_Options_In_Listbox(){

                               WebElement Groupid_select=driver.findElement(“selenium_commands”));

                                Select group=new Select(Groupid_select);

                                group.selectByVisibleText(“Browser Commands”);

                                group.selectByVisibleText(“Navigation Commands”);

                                group.selectByVisibleText(“Wait Commands”);



                public void Submit_Form(){

                                driver.findElement(“submit”)).click();  // click on the Submit button




                public static void main(String[] args) {

                                // TODO Auto-generated method stub

                               Webdriver_Practice d=new Webdriver_Practice();









Please click here to Read Browser Launch in Selenium Webdriver

Please click here to Read X-path through Firebug and FirePath

Leave a Comment