Bug 39427 - HTTP Proxy Server overwrites selected item
Summary: HTTP Proxy Server overwrites selected item
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.1.1
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-27 11:47 UTC by Pascal Alich
Modified: 2007-05-04 02:46 UTC (History)
0 users



Attachments
variant of the bug, test plan that cant be recorded with the http proxy to without severe problems (30.89 KB, application/octet-stream)
2007-03-20 09:27 UTC, Nino Martinez
Details
Suggested patch (1.14 KB, patch)
2007-05-02 06:24 UTC, Alf Hogemark
Details | Diff
Improved patch (868 bytes, patch)
2007-05-03 03:03 UTC, Alf Hogemark
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Alich 2006-04-27 11:47:05 UTC
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).
Comment 1 Sebb 2006-05-26 14:41:43 UTC
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.
Comment 2 Nino Martinez 2007-03-20 09:27:50 UTC
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.
Comment 3 Alf Hogemark 2007-05-02 06:24:47 UTC
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.
Comment 4 Alf Hogemark 2007-05-03 03:03:40 UTC
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.
Comment 5 Alf Hogemark 2007-05-04 02:27:54 UTC
(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.
Comment 6 Sebb 2007-05-04 02:46:00 UTC
Thanks!
Comment 7 The ASF infrastructure team 2022-09-24 20:37:37 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1715