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

[GitHub] [jmeter] vlsi opened a new pull request, #5944: feat: Enable usage of ${...} expressions for checkbox controls

vlsi opened a new pull request, #5944:
URL: https://github.com/apache/jmeter/pull/5944

   ## Description
   
   The checkbox can be converted to an editable field by calling a context menu:
   * right-click on the checkbox
   * or press shift+F10
   
   The editable box converts back to a checkbox if you select "true" or "false"
   
   Fixes https://github.com/apache/jmeter/issues/1252
   See https://github.com/apache/jmeter/pull/5761
   
   ## Motivation and Context
   
   Previously, JMeter did not allow users to use `${...}` expressions for checkbox elements, however, there are cases when the checkbox should be customizable.
   For instance, users might want to test different values `enable keepalive` setting, and currently it is not possible to configure it from a property file.
   
   ## How Has This Been Tested?
   
   Only manual testing for now :-/
   
   ## Screenshots (if appropriate):
   
   ## Checklist:
   <!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
   <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
   - [ ] My code follows the [code style][style-guide] of this project.
   - [ ] I have updated the documentation accordingly.
   
   [style-guide]: https://wiki.apache.org/jmeter/CodeStyleGuidelines
   


-- 
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


[GitHub] [jmeter] vdaburon commented on pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "vdaburon (via GitHub)" <gi...@apache.org>.
vdaburon commented on PR #5944:
URL: https://github.com/apache/jmeter/pull/5944#issuecomment-1605558125

   Hi, 
   I think this new features (right click : context menu and select box)  are not described in the Test Plan help documentation 
   https://jmeter.apache.org/usermanual/component_reference.html#Test_Plan
   and
   Http Sampler documentation 
   https://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request
   
   Regards.


-- 
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


[GitHub] [jmeter] vlsi commented on pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi commented on PR #5944:
URL: https://github.com/apache/jmeter/pull/5944#issuecomment-1570005381

   I rearranged the commits, and will split them into different PRs soon.
   
   For reference, here are the changes to migrate `TestPlan` to editable checkboxes: https://github.com/apache/jmeter/pull/5944/commits/3943b08c7c20f20ef5aecca7c709d848deca3ec0
   
   ```diff
   -    private final JCheckBox serializedMode;
   +    private final JBooleanPropertyEditor serializedMode =
   +            new JBooleanPropertyEditor(TestPlanSchema.INSTANCE.getSerializeThreadgroups(), "testplan.serialized");
   
   -            tp.setSerialized(serializedMode.isSelected());
   +            serializedMode.updateElement(tp);
   
   -            serializedMode.setSelected(tp.isSerialized());
   +            serializedMode.updateUi(tp);
   
   -        serializedMode.setSelected(false);
   +        serializedMode.reset();
   ```
   
   It looks good to me.


-- 
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


[GitHub] [jmeter] vlsi commented on pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi commented on PR #5944:
URL: https://github.com/apache/jmeter/pull/5944#issuecomment-1568847530

   I got `TestPlan` working with editable checkboxes.
   
   <img width="537" alt="Editable checkboxes in TestPlan UI" src="https://github.com/apache/jmeter/assets/213894/485db8b7-6253-4252-b218-227aad5807ad">
   
   Output xml:
   
   ```xml
   <?xml version="1.0" encoding="UTF-8"?>
   <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.5.1-SNAPSHOT b17bbbe">
     <hashTree>
       <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
         <stringProp name="TestPlan.comments"></stringProp>
         <stringProp name="TestPlan.functional_mode">asdfasdf</stringProp>
         <stringProp name="TestPlan.serialize_threadgroups">${__P(property_name)}</stringProp>
         <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
           <collectionProp name="Arguments.arguments"/>
         </elementProp>
         <stringProp name="TestPlan.user_define_classpath"></stringProp>
         <stringProp name="TestPlan.tearDown_on_shutdown">${variable_name}</stringProp>
       </TestPlan>
       <hashTree/>
     </hashTree>
   </jmeterTestPlan>
   ```


-- 
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


[GitHub] [jmeter] vdaburon commented on pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "vdaburon (via GitHub)" <gi...@apache.org>.
vdaburon commented on PR #5944:
URL: https://github.com/apache/jmeter/pull/5944#issuecomment-1565285150

   Yes interresting feature. Be carreful with compatibility with current Jmeter script.


-- 
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


[GitHub] [jmeter] vlsi merged pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi merged PR #5944:
URL: https://github.com/apache/jmeter/pull/5944


-- 
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


[GitHub] [jmeter] vlsi commented on pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi commented on PR #5944:
URL: https://github.com/apache/jmeter/pull/5944#issuecomment-1567464309

   I've added property desriptors, and the missing bit is to link "editable combobox" with `BooleanPropertyDescriptor` somehow


-- 
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


[GitHub] [jmeter] vlsi commented on pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi commented on PR #5944:
URL: https://github.com/apache/jmeter/pull/5944#issuecomment-1576720225

   I'm happy with the code and behaviour, so I will merge this soon


-- 
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


[GitHub] [jmeter] milamberspace commented on pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "milamberspace (via GitHub)" <gi...@apache.org>.
milamberspace commented on PR #5944:
URL: https://github.com/apache/jmeter/pull/5944#issuecomment-1580212591

   Perhaps need add refresh the UI when it's switch the checkbox to expression field (and return). See video.
   
   https://github.com/apache/jmeter/assets/3995882/43c13a74-e2c4-4241-8fe5-50d9ec0a3e78
   
   


-- 
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


[GitHub] [jmeter] vlsi commented on a diff in pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi commented on code in PR #5944:
URL: https://github.com/apache/jmeter/pull/5944#discussion_r1216257965


##########
src/core/src/main/java/org/apache/jmeter/testelement/AbstractTestElement.java:
##########
@@ -342,7 +343,7 @@ public int getPropertyAsInt(String key) {
 
     @Override
     public int getPropertyAsInt(String key, int defaultValue) {
-        JMeterProperty jmp = getRawProperty(key);
+        JMeterProperty jmp = getPropertyOrNull(key);
         return jmp == null || jmp instanceof NullProperty ? defaultValue : jmp.getIntValue();

Review Comment:
   Frankly speaking, `getPropertyOrNull` followed by `instanceof NullProperty` look strange, however, I do not change it in the current PR.
   However, it would probably make sense to revise it later.



-- 
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


[GitHub] [jmeter] vlsi commented on pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi commented on PR #5944:
URL: https://github.com/apache/jmeter/pull/5944#issuecomment-1580267086

   Good catch. It updates automatically in Darklaf themes, and almost all the others fail to update.


-- 
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


[GitHub] [jmeter] vlsi commented on pull request #5944: feat: Enable usage of ${...} expressions for checkbox controls

Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi commented on PR #5944:
URL: https://github.com/apache/jmeter/pull/5944#issuecomment-1581148447

   I've added relayoyt in https://github.com/apache/jmeter/commit/f4d312c26f0b859f8a68007c4c5e649d259998aa


-- 
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