jmeter icon indicating copy to clipboard operation
jmeter copied to clipboard

Cursor position in test plan changes jmx file

Open koudela5 opened this issue 1 year ago • 2 comments

Expected behavior

If you save a JMeter plan with no changes in the test plan then outputed jmx file is still same no matter where you had the cursor while saving the test plan.

Actual behavior

Outputed jmx file is different based on the cursor position while saving the test plan. It is hard to track changes of jmx file because of this.

Steps to reproduce the problem

Open the attached sample test plan then select Thread Group and save the plan (or you can just try to close JMeter application and you will be notified that there are some changes in the test plan) and compare the outputed file with the original one, you will see the differences. Different position of the cursor in the test plan produces different output. sample.zip

JMeter Version

5.6.3

Java Version

No response

OS Version

No response

koudela5 avatar Jan 09 '24 10:01 koudela5

The diff is that enabled=true appears only for the elements that were selected

--- sample2.jmx	2024-01-09 14:04:16
+++ sample3.jmx	2024-01-09 14:03:44
@@ -27,7 +27,7 @@
         </collectionProp>
       </Arguments>
       <hashTree/>
-      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group">
+      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
         <intProp name="ThreadGroup.num_threads">1</intProp>
         <intProp name="ThreadGroup.ramp_time">1</intProp>
         <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
@@ -38,7 +38,7 @@
         </elementProp>
       </ThreadGroup>
       <hashTree>
-        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Request">
+        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Request" enabled="true">
           <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
           <stringProp name="HTTPSampler.method">GET</stringProp>
           <boolProp name="HTTPSampler.use_keepalive">true</boolProp>

vlsi avatar Jan 09 '24 11:01 vlsi

I see the opposite. When you open "sample.jmx" and then immediately save the file you will see something what you can see on the screenshot (every single element has enabled=true, probably all elements have their default values saved, see what was saved for the test plan). image enabled=true disappears only for the elements that were selected, i.e. when you open a test plan, select some elements and save, then the elements you selected were saved without enabled=true the other were saved with enabled=true.

This is complication for the development because you see the changes you haven’t done upon the commit.

Every time the test plan is loaded then a default value is appended to all elements.

koudela5 avatar Jan 09 '24 14:01 koudela5