Back to Course
Rest Assured

Payload extraction from excel sheets

How It Works

A Java library such as Apache POI reads data from an Excel file cell by cell, which the automation code then assembles into a JSON (or other) request payload before sending it via Rest Assured.

Example Flow

Workbook wb = WorkbookFactory.create(new FileInputStream("data.xlsx"));
Sheet sheet = wb.getSheet("Users");
String name = sheet.getRow(1).getCell(0).getStringCellValue();
String job = sheet.getRow(1).getCell(1).getStringCellValue();

given().contentType("application/json")
    .body("{ \"name\":\"" + name + "\", \"job\":\"" + job + "\" }")
.when().post("/users")
.then().statusCode(201);

Why This Matters

This is the core mechanism that powers a payload-driven framework, letting one test method run repeatedly with many different data combinations pulled straight from the spreadsheet.

Ready to master real-world software testing?

Learn manual and automation testing hands-on with mentor-led sessions.

Explore Course