Forum Discussion
Here is a sample script,
import java.io.File;
import java.io.FileInputStream;
import java.util.Iterator;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
FileInputStream file = new FileInputStream(new File('C:\\sample.xls'));
XSSFWorkbook workbook1 = new XSSFWorkbook(file)
XSSFSheet sheet1 = workbook1.getSheetAt(0)
Iterator ite = sheet1.rowIterator();
headers=[]
Row row = ite.next();
Iterator<Cell> cite = row.cellIterator();
while(cite.hasNext()){
Cell c = cite.next();
headers << c.toString()
}
file.close();
log.info headers
for ( i in headers ) {
testRunner.testCase.testSteps["DataSource"].addProperty(i);
}Hi Could someone please let me know what JAR files need to be imported to the "C:\Program Files\SmartBear\SoapUI-X.X.X\lib" folder for this to work? I have the JAR files listed below and get error "java.lang.NoClassDefFoundError: org/apache/commons/collections4/ListValuedMap" when running this code
dom4j-1.6.1
poi-3.15
poi-ooxml-3.15
poi-ooxml-schemas-3.15
xmlbeans-2.6.0
Thanks
- babusr0110 years agoContributor
Hi
You can try in keeping in \Exe folder..
- zpaya9 years agoSenior Member
timaharrison For 'listvaluedmap' error you have to include 'Commons-collections4' v4.1 or above in /bin/ext folder.
- SD319 years agoNew Contributor
I have downloaded the above mentioned jar files, collections and pasted in /bin/ext, still getting same error.
PS: I have restarted SOAP UI application even.
please help!
Edit1: Issue has resolved, when the collection jar moved from /bin/ext to /lib :smileyhappy: