- Sample Excel –> Sorry I’m not allowed to attached a image..
- TC No. | Title | Result
- 1 | State and Vin | Failed
- 2 | State and Reg Code | Passed
- 3 | Booking a Test Drive | Passed
public class sampleTest{
public static void main(String[] args) throws Exception {
int iTest = 2, iTest2 = 3;
if (iTest == iTest2){
//It will pass a value into the excel (e.g. "Passed")
}
else{
//It will pass a value into the excel (e.g. "Failed")
}
}
My program’s goal is to generate a report by getting the Passed and Failed results from my tests. My main problem here is on how to read the results from the excel and place the value “Passed” or “Failed” under Result column.
Via library that will be your interface to Excel document. One option is Apache POI. Excel example code can be found from here.
Other option is Java Excel API.