Search code examples
jmeterperformance-testingbeanshell

JMeter altering values in .xls files using bean shell processor


I have a JMeter script where I should access a .xls file with multiple tabs and alter values . The .xls file has values like , RASD1234,TWER1234,ZAST1234 . I should change the numeric value to unique values each iteration like RASD1235,TWER1235,ZAST1235 in all tabs . How can I achieve this in JMeter


Solution

    1. Download tika-app.jar and put it into JMeter Classpath
    2. Restart JMeter to pick the .jar up
    3. Once you do this you will be able to use POI-HSSF API to edit the Excel file

    Just one piece of advice: since JMeter 3.1 you should be using JSR223 Test Elements and Groovy language for scripting so consider doing this in Groovy (normal Java syntax will also work)

    References (including code snippets)