Read and Write Data into Excel in REST-assured || Episode#5

Описание к видео Read and Write Data into Excel in REST-assured || Episode#5

In this video we will see
1. How to read and write data into excel sheet in REST-assured.
2. How to create a reusable method to read and write data into Excel sheet.

#########Relevant Videos########
0. Introduction to REST-assured capability using TESTNG frame work || Episode#0
   • Introduction to REST-assured capabili...  
1. Testing GET,POST,PUT, PATCH and DELETE requests using REST-assured || Episode#1
   • Testing GET,POST,PUT, PATCH and DELET...  
2. Automation of API tests using Assertions and Parsing(JSON array,Hashmap,String,Integer) the JSON response in REST-assured || Episode#3
   • API Automation by Assertions&Parsing(...  
3. Testing APIs with header,query and Authentication parameters in REST-assured || Episode#2
   • Testing APIs with header,query and Au...  
4. How to pass/fail an API test in REST-assured/TESTNG without using Assertions || Episode#4
   • How to pass/fail an API test in REST-...  
5. ExtentReporting in REST-assured || Episode#6
   • ExtentReporting in REST-assured || Ep...  
6. API Automation framework using REST-assured in 5 mins || Episode#7
   • Complete API Automation framework usi...  
################################

########### CODE USED IN THE VIDEO############
public void WriteData_Excel(String dataPath,Object writethis,int row,int col,CellType type) throws IOException{

File excelFile = new File(dataPath);
FileInputStream file = new FileInputStream(excelFile);
XSSFWorkbook workbook = new XSSFWorkbook(file);
XSSFSheet sheet = workbook.getSheetAt(0);
//CellType.STRING
//sheet.createRow(row);
sheet.getRow(row).createCell(col).setCellType(type);
//sheet.getRow(1).createCell(4).setCellType(CellType.NUMERIC);
//sheet.getRow(1).createCell(5).setCellType(CellType.STRING);
sheet.getRow(row).getCell(col).setCellValue(writethis.toString());
//sheet.getRow(1).getCell(4).setCellValue(resp.statusCode());
//sheet.getRow(1).getCell(5).setCellValue(resp.asString());

FileOutputStream outFile = new FileOutputStream(excelFile);
workbook.write(outFile);
workbook.close();
outFile.close();
file.close();
}
##########################################

Комментарии

Информация по комментариям в разработке