0% found this document useful (0 votes)
27 views4 pages

17.10.23 - Agenda - Hooks

The document discusses using Apache POI to access Microsoft Excel test data in automation frameworks. It defines key terms used by Apache POI to work with Excel, including workbook, sheet, row, and cell. Cucumber hooks are described as blocks of code that run before or after each scenario to manage code workflow and reduce redundancy by performing prerequisites and cleanup steps.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
27 views4 pages

17.10.23 - Agenda - Hooks

The document discusses using Apache POI to access Microsoft Excel test data in automation frameworks. It defines key terms used by Apache POI to work with Excel, including workbook, sheet, row, and cell. Cucumber hooks are described as blocks of code that run before or after each scenario to manage code workflow and reduce redundancy by performing prerequisites and cleanup steps.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 4

Cucumber BDD Framework

Hooks
Apache POI (Poor Obfuscation Implementation)
The test data plays an important role. The test automation framework developers maintain the test data in various
formats and Microsoft Excel is one of the easiest and most used ways of storing and maintaining test data. Even the
manual QAs keep their test data in Excel files. Now to access this test data in the automation frameworks, Java
provides various libraries and Apache POI is one of the most used among them.
pache POI uses certain terms to work with Microsoft
Excel. Let's get familiar with these before we go into the
details of the code.
Term Details
A workbook represents a
Microsoft Excel file. It can be
used for creating and
Workbook
maintaining the spreadsheet. A
workbook may contain
many sheets.
A sheet refers to a page in a
Microsoft Excel file that
Sheet
contains the number
of rows and columns.
A row represents a collection
of cells, which is used to
Row
represent a row in the
spreadsheet.
A cell is indicated by a row and
column combination. Data
entered by a user is stored in a
Cell
cell. Data can be of the type
such as string, numeric value, or
formula.
Hooks
Cucumber hooks are blocks of code that run before or after each scenario. You can define them
anywhere in your project or step definition layers, using the methods @Before and @After. Cucumber
Hooks allows us to better manage the code workflow and helps us to reduce the code redundancy.
We can say that it is an unseen step, which allows us to perform our scenarios or tests.

This prerequisite can be anything from:


•Starting a webdriver
•Setting up DB connections
•Setting up test data
•Setting up browser cookies
There are always after steps as well of the tests
•Navigating to certain page
like:
•or anything before the test •Killing the webdriver
•Closing DB connections
•Clearing the test data
•Clearing browser cookies
•Logging out from the application
•Printing reports or logs
•Taking screenshots on error
•or anything after the test

You might also like