How to browse Excel file in JMeter?



  • Use case :

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

    enter image description here



  • 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.


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2