I'm using some jmeter functions in my jmx file. When I run it from command line with jmeter tool, its running normally, executing the function and return a value.
When I run the java code , which load the same jmx file its taking a function as a string and don't return a value.
I have tested with several functions, Results are the same. In jtl file I see something like this- ${__time(yyyy-MM-dd HH:mm:ss)}
<httpSample t="663" it="0" lt="631" ts="1492989803759" s="true" lb="User-getapikey ${__time(yyyy-MM-dd HH:mm:ss)} " rc="200" rm="" tn="Thread Group 1-1" dt="text" de="UTF-8" by="528" ng="1" na="1">
Its my java code, its working normally when I don't have a functions:
StandardJMeterEngine jmeter = new StandardJMeterEngine();
JMeterUtils.loadJMeterProperties(jmeterPropertiesPath);
JMeterUtils.setJMeterHome(jmeterHomePath);
JMeterUtils.initLogging();
JMeterUtils.initLocale();
SaveService.loadProperties();
HashTree testPlanTree = null;
try{
log.info("loading testPlanTree");
testPlanTree = SaveService.loadTree(jmxFile);
JMeter.convertSubTree( testPlanTree );
}catch(IOException ex){
log.info("error loading file as tree");
log.info(ex.getMessage());
return;
}
jmeter.configure(testPlanTree);
jmeter.run();