I am trying to read the values from Excel using selenium java through eclipse. Imported the apache poi jar files successfully.
public class DDT {
public static void main(String[] args) throws EncryptedDocumentException, IOException {
FileInputStream fis = new FileInputStream("E:\DDT\DDT.xlsx");
Workbook wb = WorkbookFactory.create(fis);
String str = wb.getSheet("Sheet1").getRow(1).getCell(1).getStringCellValue();
System.out.println(str);
}
}
Trying to find a solution mostly suggested to make change in pom.xml file. But in my porject i don’t have an pox.xml file. how to solve this?
Output error:
pom.xml is used for a maven project. It is not a required precondition for a java project.
You can add the required 3rd party library the referenced libraries of Eclipse.
You can try the solution in How to add a reference in Eclipse. add the required apache poi library to your project before run it.
If the POI library is already added to the project. Please expand the library to confirm the required class file(org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream.class) exists in jar file.
the screenshot is for your reference.
3