Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Selenium Framework for Beginners 18 | How to use Excel for getting data in Selenium Java Framework

Автор: Automation Step by Step

Загружено: 2018-08-09

Просмотров: 131612

Описание:

Also check this -    • How to read excel in Java  
Website - https://automationstepbystep.com/
Today we will learn Why to use excel files
How to add excel libraries
How to create excel read function
GetRowCount
GetCellData
How to call excel functions
helpful tips

Free Courses - https://automationstepbystep.com/

Why to use excel file

In Selenium we can get data from external files like excel and csv

MS Excel is most commonly used

Helps to make our scripts independent of data handling

Helps to add, update, manage data separately (outside the framework)

Helps to make our framework data driven

How to add excel libraries

Step 1
Add apache poi libraries
Download and add Jars
from : https://poi.apache.org/download.html
OR
Add maven dependency
From : https://mvnrepository.com/artifact/or...


Step 2
Check if the libraries are added in your project

Get Row Count

Step 1
Create excel file and add some data

Step 2
Create references for Workbook

for new excel format (xlsx)
XSSFWorkbook workbook = new XSSFWorkbook(“excel file location”);

for old excel format (xls)
HSSFWorkbook workbook = new HSSFWorkbook(“excel file location”);

Step 3
Create references for Worksheet

XSSFSheet sheet = workbook.getSheet(“sheet name”);


Step 4
Call row count function

sheet.getPhysicalNumberOfRows();


Get Cell Data

Step 1
Create references for Workbook

XSSFWorkbook workbook = new XSSFWorkbook(“excel file location”);


Step 2
Create references for Worksheet

XSSFSheet sheet = workbook.getSheet(“sheet name”);


Step 3
Call function to get cell data

sheet.getRow(rownum).getCell(colnum).getStringCellValue();

sheet.getRow(rownum).getCell(colnum).getNumericCellValue();


How to call excel functions

Step 1
In all excel functions get rowNum, colNum as parameters

This is to avoid hard coding of values and get the values from calling function

Step 2
Create a constructor

A constructor is a special method without any return type and name same as the class name

Constructor is called every time a class object is created using the new() keyword

Step 3
Parametrize the constructor
To get excel path and sheet name

Step 4
Create a new class to call excel functions

Like, Subscribe & Share
You can support my mission for education by sharing this knowledge and helping as many people as you can

Never Stop Learning
Raghav

Selenium Framework for Beginners 18 | How to use Excel for getting data in Selenium Java Framework

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Selenium Framework for Beginners 19 | Selenium TestNG How to get data from Excel using DataProvider

Selenium Framework for Beginners 19 | Selenium TestNG How to get data from Excel using DataProvider

Selenium Framework for Beginners 10 | What is Extent Reports | How to use Extent Reports in Selenium

Selenium Framework for Beginners 10 | What is Extent Reports | How to use Extent Reports in Selenium

Война завершается / НАТО вступает в бой / Атака на остров

Война завершается / НАТО вступает в бой / Атака на остров

Selenium Framework for Beginners 14 | What is Log4j | How to add Log4j in java project

Selenium Framework for Beginners 14 | What is Log4j | How to add Log4j in java project

All OOP Concepts in POM-Use of Abstract Class,Inheritance,Overloading,Overriding,Encapsulation

All OOP Concepts in POM-Use of Abstract Class,Inheritance,Overloading,Overriding,Encapsulation

Selenium Java Framework for Beginners

Selenium Java Framework for Beginners

Selenium Framework for Beginners 1 | Getting Started | How to setup Selenium Java project in Eclipse

Selenium Framework for Beginners 1 | Getting Started | How to setup Selenium Java project in Eclipse

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

Что такое Rest API (http)? Soap? GraphQL? Websockets? RPC (gRPC, tRPC). Клиент - сервер. Вся теория

Что такое Rest API (http)? Soap? GraphQL? Websockets? RPC (gRPC, tRPC). Клиент - сервер. Вся теория

Selenium Framework for Beginners 29 | Selenium Waits | How to use Implicit and Explicit waits

Selenium Framework for Beginners 29 | Selenium Waits | How to use Implicit and Explicit waits

How to Read Excel File using Apache POI | Selenium WebDriver |

How to Read Excel File using Apache POI | Selenium WebDriver |

4 часа Шопена для обучения, концентрации и релаксации

4 часа Шопена для обучения, концентрации и релаксации

SHAZAM Top 50🏖️Лучшая Музыка 2025🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно #40

SHAZAM Top 50🏖️Лучшая Музыка 2025🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно #40

Как превратить таблицы Excel в мощные приложения (2025) | Пошаговое руководство для начинающих

Как превратить таблицы Excel в мощные приложения (2025) | Пошаговое руководство для начинающих

Selenium Framework for Beginners 20 | What are TestNG Listeners | How to use TestNG Listeners

Selenium Framework for Beginners 20 | What are TestNG Listeners | How to use TestNG Listeners

Selenium Framework for Beginners 7 | What is Page Object Model (POM) | How to create POM in Selenium

Selenium Framework for Beginners 7 | What is Page Object Model (POM) | How to create POM in Selenium

Feeling Good Mix - Emma Péters, Carla Morrison

Feeling Good Mix - Emma Péters, Carla Morrison

Понимание Active Directory и групповой политики

Понимание Active Directory и групповой политики

Selenium Framework for Beginners 17 | What is Properties File | How to use

Selenium Framework for Beginners 17 | What is Properties File | How to use

50 шедевров классической музыки для отдыха и души | Бетховен, Моцарт, Шопен, Бах, Вивальди

50 шедевров классической музыки для отдыха и души | Бетховен, Моцарт, Шопен, Бах, Вивальди

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]