I have enroll students via bulk upload process through xls document in my application. Can you explain step by step process for upload student details through xls document in Jmeter3.0.
Thanks, Vairamuthu.
I have enroll students via bulk upload process through xls document in my application. Can you explain step by step process for upload student details through xls document in Jmeter3.0.
Thanks, Vairamuthu.
As far as I know JMeter doesn't supply a sampler to upload from xls directly.
So I suggest to convert the input file in CSV and use the Config element "CSV Data Set Config". You can find a lot of step-by-step examples on internet.
Anyway, you can read xls file using Apache Tika and BeanShell (sampler, pre or post processor depending on your needs and test plan).
Here an example using HTTP request sampler to read the xls file (or more generic a binary file):
Copy tika-app.jar file to jmeter/lib directory.
Restart JMeter
Open a JMeter test plan and add Thread group
Add an "HTTP request" sampler.
Nested to "HTTP Request" add a "BeanShell PostProcessor"
import org.apache.jmeter.threads.JMeterVariables; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; try { InputStream in = new ByteArrayInputStream(data); Workbook wb = new XSSFWorkbook(in); in.close(); Sheet sheet1 = wb.getSheet("Sheet1"); Row row = sheet1.getRow(1); Cell a1 = row.getCell(0); Cell b1 = row.getCell(1); Cell c1 = row.getCell(2); vars.put("A1", a1.getStringCellValue()); vars.put("B1", b1.getStringCellValue()); vars.put("C1", c1.getStringCellValue()); } catch (Throwable ex) { log.error("Failed ", ex); }
This is just an example about xls reading in JMeter, then you can decide to start from here to get something useful.
See also these articles from BlazeMeter or tech-doing.com