When specifying a script file in the BSF post-processor, the filename is treated as a code snippet instead of being loaded, taking precedence over the regular script. This likely also affects the BSF Preprocessor, Assertion, and Listener, as they all call the BSFTestElement.processFileOrScript(BSFManager) method. The processFileOrScript method currently takes the filename and passes it directly to the script manager for evaluation instead of loading the file and passing its contents to the script manager. Steps to Reproduce: - Create new Test Plan - Add a new Thread Group - Add a new sampler (tested with a Debug Sampler) - Add a new BSF Postprocessor - Choose an available BSF language (Tested with "javascript") - Input valid javascript as filename (Tested with OUT.println("--- filename ---")) - Input valid javascript as script (Tested with OUT.println("--- script ---");) - Execute test Expected Results: - Postprocessor fails, unable to find file Actual Results: - Console output: "--- filename ---"
Created attachment 23031 [details] Test case illustrating issue (watch the console output)
Affects nightly build from r724447
Thanks for the bug report. The code for processing script files was completely broken - it did not bother reading the file - oops! Fixed in SVN in r728228.
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2182