0

Use case :

I need to import orders from Excel file. I need to browse a Excel file.

enter image description here

1

As the attached image shows that user needs to browse the excel sheet.I was also faced the same situation. So, Assuming that request for the same has been recorded. Follow below instructions:

  1. Use beanshell post processor and write code to read the excel file. {It is similar to Java IO file read code} like this
   import org.apache.jmeter.threads.JMeterVariables;

   import java.io.File;

   import java.io.IOException;


    File data = new File("/path/to/your/file.xlsx")
  1. In that code assign "data" object to the JMeter variable like this

    vars.put("A1", data.getAbsolutePath());

  2. Pass variable "A1" to the request recorded for browsing the file.

Taken reference from How to Extract Data From Files With JMeter This might helps you.

0

I did it by putting the file path in File Upload section with POST request. enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.