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); }
- babusr019 years agoContributor
thanks and its working.
- JKambli9 years agoStaff
Thanks for the update. Can you mark this post as resolved.
- timaharrison9 years agoOccasional Contributor
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
- babusr019 years agoContributor
Hi
You can try in keeping in \Exe folder..
- zpaya8 years agoSenior Member
timaharrison For 'listvaluedmap' error you have to include 'Commons-collections4' v4.1 or above in /bin/ext folder.
- SD318 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:
Related Content
- 10 months ago
- 3 years ago
- 5 years ago
Recent Discussions
- 18 days ago