Question

I would like to start jmeter load test via console but it's Data Driven Load Test, so I need to read some information from csv files. I found a solution to include into User Parameters row to get the path to the place where the script was launched:

${__BeanShell(newFile(org.apache.jmeter.gui.GuiPackage.getInstance().getTestPlanFile().toString()).getParent())}

but I got an error in logs:

2013/06/11 15:23:54 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``newFile(org.apache.jmeter.gui.GuiPackage.getInstance().getTestPlanFile().toStrin . . . '' : Command not found: newFile( java.lang.String )

2013/06/11 15:23:54 WARN - jmeter.functions.BeanShell: Error running BSH script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``newFile(org.apache.jmeter.gui.GuiPackage.getInstance().getTestPlanFile().toStrin . . . '' : Command not found: newFile( java.lang.String ) at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:192)

What's wrong with this method?

Was it helpful?

Solution

The issue is you have:

  • newFile

instead of:

  • new File
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top