The test scripts on GUI works perfect but not in the non-GUI mode.Image showing Terminal test execution
Explanation:
I have 3 thread groups in the test plan, where the first Thread Group
creates 3 .csv
files and are expected to feed the data in the CSV files into the second Thread Group
.
For few test runs, Non-GUI mode worked great but then, the tests Intermittently like this [Terminal showing test run], doesn't create the CSV
files at all and also,
sometimes, third Thread Group doesn't execute at all.
The problem I noticed is:
During the NOn-GUI tests the files are not been creating, so that's the reason the next Thread groups weren't able to pick up and use the variables inside
CSV
file and alsoThe second One could be: I'm saving folder and file paths in the ${__setProperty(prop_folder_Path,${File_Path})} and getting the prop.
${__property(prop_folder_Path)}
in another Thread Group -> Sometimes this property function Doesn't work and files are saving in/bin
DirectoryIs there a way to use
${__property(prop_folder_Path)}
value in BeanShell POStProcessor ?
I believe whatever works in the GUI should work same in the Non-GUI too, AM I right?
I Just noticed that output files are creating in /bin folderas shown here while running the tests in NOn-GUI
Any suggestions to fix this. Thank you
import org.apache.jmeter.services.FileServer; //gets path of current jmeter's script String path = FileServer.getFileServer().getBaseDir()+File.separator+"Output"; File f = new File(path ); f.mkdirs(); vars.put("v_folder_path",path);
And I appened the path + file.separator + "new_file_name.csv" I believe this makes less manual work and asily trackable. I've executed the tests for quite some test runs and they were successful., – JalVIFileServer.getFileServer().getBaseDir()
is the same asSystem.getProperty("user.dir")
by default, and as far as I can tell is only changed to script path by GuiPackage class, which might explain difference in behaviour you are observing between gui and non-gui. But why are you using the function/location that you don't control? Isn't it better to stick to system defaults, likeSystem.getProperty("java.io.tmpdir")
? – Kiril S.