You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "koudela5 (via GitHub)" <gi...@apache.org> on 2024/01/09 10:05:45 UTC

[I] Cursor position in test plan changes jmx file [jmeter]

koudela5 opened a new issue, #6221:
URL: https://github.com/apache/jmeter/issues/6221

   ### 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](https://github.com/apache/jmeter/files/13872087/sample.zip)
   
   
   ### JMeter Version
   
   5.6.3
   
   ### Java Version
   
   _No response_
   
   ### OS Version
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cursor position in test plan changes jmx file [jmeter]

Posted by "koudela5 (via GitHub)" <gi...@apache.org>.
koudela5 commented on issue #6221:
URL: https://github.com/apache/jmeter/issues/6221#issuecomment-1883170067

   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](https://github.com/apache/jmeter/assets/113984709/1863737d-18da-4353-8cb3-cadbb0034c77)
   `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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cursor position in test plan changes jmx file [jmeter]

Posted by "btocquec (via GitHub)" <gi...@apache.org>.
btocquec commented on issue #6221:
URL: https://github.com/apache/jmeter/issues/6221#issuecomment-3252890545

   Hello! I agree, annoying on commiting and merging ! 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cursor position in test plan changes jmx file [jmeter]

Posted by "markjanstice (via GitHub)" <gi...@apache.org>.
markjanstice commented on issue #6221:
URL: https://github.com/apache/jmeter/issues/6221#issuecomment-4092233450

   This commit https://github.com/apache/jmeter/pull/6199/changes/9b258623b07962195230fa9cd416120967ea7d4f changed AbstractJMeterGuiComponent.java which sets the enabled attribute to null if true, essentially that means the attribute is no longer included when serializing to the jmx file when saved, so it can disappear. 
   I've not debugged the code, but it seems when a node is clicked in the JMeter UI modifyTestElement is called, and that calls the affected modifyTestElementEnabledAndComment.
   This is the line in question:
   `mc.set(TestElementSchema.INSTANCE.getEnabled(), enabled ? null : Boolean.FALSE);`
   The comment in the code above that line implies it doesn't have to be this way:
   ```
   // We can skip storing "enabled" state if it's true, as it's default value.
   // JMeter removes disabled elements early from the tree, so configuration elements
   // with enabled=false (~HTTP Request Defaults) can't unexpectedly override the regular ones
   // like HTTP Request.
   
   ```
   However there may be fallout that I haven't considered by reverting back to:
   `mc.setEnabled(enabled);`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cursor position in test plan changes jmx file [jmeter]

Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi commented on issue #6221:
URL: https://github.com/apache/jmeter/issues/6221#issuecomment-1882866557

   The diff is that `enabled=true` appears only for the currently selected element
   
   ```diff
   --- 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>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cursor position in test plan changes jmx file [jmeter]

Posted by "TeddMcAdams (via GitHub)" <gi...@apache.org>.
TeddMcAdams commented on issue #6221:
URL: https://github.com/apache/jmeter/issues/6221#issuecomment-2674735931

   Bump, super annoying and weird behavior.  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org