Assuming that the HTTP Proxy Server is running and a specific target controller is set. If a new request is recorded while a different HTTP Request in the JMeter tree is selected, that request is overwritted by the new one. The new request addionally can be found in the destination controller of the proxy (as desired).
Another symptom is that a new sampler is created in the correct place, but the settings of the selected sampler are changed - in particular, the parameters and values are changed. This does not seem to be easy to fix. The work-round is to ensure that the Proxy server remains selected until the recording has finished.
Created attachment 19757 [details] variant of the bug, test plan that cant be recorded with the http proxy to without severe problems There are an additional variant of this bug, following the workaround Sebb mentions does not fix this variant. Some times the recording goes through just fine(rare), both mostly 10% gets recorded to the selected recording controller, and rest to a random recording controller. Sometimes the http proxy looses its settings (port name etc), this is a typical symptom of the variant. I've also expirenced a few times that some settings are duplicated(80808080 instead of 8080 as proxy port) If somehow the file should dissapear, i'll describe the structure of the test plan here: Test plan -Thread Group 01 (disabled) --Recording Controller 1 --Recording Controller 2 --Recording Controller 3 --Recording Controller 4 --Recording Controller 5 --Recording Controller ... --Recording Controller 15 -Thread Group 02 --Recording controller 01 -Thread Group 03 --Recording controller 01 -Thread Group .. --Recording controller 01 -Thread Group 08 --Recording controller 01 -Thread Group 09 --Interleave Controller 01 ---Recording Controller 01 ---Recording Controller 02 ---Recording Controller 03 ---Recording Controller 04 ---Recording Controller 05 -Agregate report -View result in table -View result in tree Also all threads has an adittional pair of these: -Agregate report -View result in table -View result in tree And all HTTP request uses test plan variables server & port.
Created attachment 20089 [details] Suggested patch I've looked at this issue today. To me, the problem seems to be caused by the handling of the "current node" in GUI. When a sample is added to the test plan, the correct GUI component is used for the sample. There is only one instance of the GUI class, and this class is reused for each sample being constructed and put into the plan. Somehow, the "current node / gui node" becomes incorrect, and the selected item in the GUI is incorrectly updated. In the JMeterTreeModel.addComponent method, the current GUI state is "stored" in the test element for the node by GuiPackage.getInstance().updateCurrentNode(). Then the GUI component for the test element being added is retrieved by JMeterGUIComponent guicomp = GuiPackage.getInstance().getGui(component). Then the state is copied from the "test element" to the GUI instance by guicomp.configure(component); Then the state of the GUI instance is copied to the test element by guicomp.modifyTestElement(component); Finally, from the comment, it seems like the GUI instance should be put back to the state it was in when the state for the current node was stored, by " GuiPackage.getInstance().getCurrentGui(); // put the gui object back // to the way it was." However, this is not what is happening when running the Proxy, and selecting a sample in the test plan, and then entering an URL in the browser. In that case, "GuiPackage.getInstance().getCurrentGui()" causes the GUI state of the newly added test element to be copied to the test element that the user had selected in the test plan before entering the URL in the browser. By applying this suggested patch, I can selected items in the test plan while the proxy is running, and the item will not change, even if new items are added to the test plan by the proxy because of browser activity. Perhaps someone can explain what the lines I suggest to delete are meant to do ? And / or give some input on scenarios that should be tested to check that things still work, I'm mainly thinking about other scenarios than using the Proxy.
Created attachment 20113 [details] Improved patch This patch also solves the bug. The problem is that the GUIPackage does not keep correct track of what is the current node, and if the test element needs to be updated from the GUI. By always setting "currentNodeUpdated = true" at the end of "updateCurrentNode" method, the problem seems to be solved.
(In reply to comment #4) This bug can be set to "fixed" now, because the suggested patch is applied as part of the fix for bug 30120.
Thanks!
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1715