Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Selenium Essentials

You're reading from   Selenium Essentials Get to grips with automated web testing with the amazing power of Selenium WebDriver

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher
ISBN-13 9781784394332
Length 194 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Prashanth Sams Prashanth Sams
Author Profile Icon Prashanth Sams
Prashanth Sams
Arrow right icon
View More author details
Toc

JXL API Data-Driven framework


Data-Driven testing is a software-testing methodology, which is an iterative process to assert the actual value with the expected value that fetches test input data from an external or internal data source. Data-Driven tests are generally carried out with bulk input data.

Java Excel API is termed the JXL API. It is the most widely used API for executing Selenium Data-Driven tests that allows the user to read, write, create, and modify sheets in an Excel Binary (.xls) workbook at runtime. JXL API has no support for SpreadsheetML (.xlsx) workbooks.

Reading and writing in an Excel sheet

The API reads data from Excel Binary workbooks with versions Excel 95, 97, 2000, XP, and 2003. The following snippet tells you how to read an Excel Binary workbook:

FileInputStream fi = new FileInputStream("C:\\...\inputdata.xls");
Workbook wb = Workbook.getWorkbook(fi);
Sheet ws = wb.getSheet(0);
String a[][] = new String[ws.getRows()][ws.getColumns()];

for (int rowCnt = 1; rowCnt...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime