I follow methods introduced in the this thread and then save the hashTree as follow:
FileOutputStream out = new FileOutputStream("test.jmx");
SaveService.saveTree(hashTree, out);
But, JMeter fails to open the file:
Is it possible to save and restore created test?
In the other hand, there is a project on GitHub to create and save test. How ever the result is not valid JMX file.
I compare created file with a simple JMeter valid test script. These attributes are not added:
guiclass="TestPlanGui" testclass="TestPlan"
I add them manually and all error fixed?!
Test and GUI classes must set as properties in a test element. Here is part of AbstractJMeterGuiComponent :
mc.setProperty(new StringProperty(TestElement.GUI_CLASS, this.getClass().getName()));
mc.setProperty(new StringProperty(TestElement.TEST_CLASS, mc.getClass().getName()));
So, GUI and the core is tied to each other and there are some main configurations in GUI.
How to build a valid JMX whiteout know about GUI?