How to automate login form using multiple users in selenium web driver in java.

Automate login form using multiple users in the selenium web driver Task.

Data-driven automation using selenium web driver. Here is the automation example using selenium web driver where we are going to automate login form using 100 users in selenium web driver in java. The task description is given below.

Selenium web driver Task Description:

Need to automation a login form with 100 users. So the challenging part is you need to automate the same login form with 100 users.


  • Create an excel file and write the username and password of 100 users.
  • Write the script to automate a login page with the loop count 100.
  • Create a separate method to read data and call the method when you need to get data from the excel file. The complete code is given below.

Automate login form using 100 users in selenium web driver in java.

import java.util.Properties;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import utilityClasses.TestListener;

publicclass Main {

 publicstatic XSSFSheet excelSheet;
 publicstatic XSSFCell cell;
 publicstatic WebDriver driver;

 publicstaticvoid main(String[] args) throws InterruptedException {

  System.setProperty("", "D:\Automation\chromedriver_win32\chromedriver.exe");
  driver = new ChromeDriver();
  excelSheet = Main.readExcel("Path of the excel file", "Sheet number");
  for (inti = 0; i<= 50; i++) {
   // Load URL getting.
   // Locate element for login and password input and send data to inputs.
   // Click to the button for login.

 publicstatic XSSFSheet readExcel(String Path, String SheetName) {
  try {
   // Open the Excel file
   FileInputStream ExcelFile = new FileInputStream(Path);
   // Access the required test data sheet
   ExcelWBook = new XSSFWorkbook(ExcelFile);
   ExcelWSheet = ExcelWBook.getSheet(SheetName);
  } catch (Exception e) {




Complete Automation tutorial using selenium web driver using java 

Complete selenium web driver tutorial


Add a Comment

Your email address will not be published.

17 − ten =