Search code examples
jmeterjcifs

JMeter - CIFS support using JCIFS


Does anyone have attempted to write a script in JMeter using JCIFS to write/read/delete file on a remote share? Thanks.


Solution

  • Extensibility is the main feature of JMeter.

    In regards to your question I would recommend the following:

    1. Download jcifs-*.jar and drop it to the /lib folder of your JMeter installation
    2. Download groovy-all-*.jar and put it to the same location
    3. Restart Jmeter
    4. Add JSR223 Sampler and put JCIFS-specific code there. See JCIFS API documentation for classes and methods reference.
    5. Make sure that "groovy" language is selected in the "Language" drop-down
    6. Add more JSR223 Samplers if needed

    Remember the following:

    • don't refer JMeter Variables as ${VAR} in groovy code
    • if you use "Script" input rather than path to groovy file - put something unique (per sampler) into the "Compilation Cache Key" input

    For detailed explanation of "why groovy", groovy scripting engine installation instructions and scripting best practices see Beanshell vs JSR223 vs Java JMeter Scripting: The Performance-Off You've Been Waiting For! guide.