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

   ### Expected behavior
   
   `Use Expression` feature in certain checkboxes in JMeter should evaluate 
`${__P(property_name)}` and `${variable_name}` value in GUI and CLI.
   
   **Expected output for the below steps:**
   
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <testResults version="1.2">
   <httpSample t="61" it="0" lt="58" ct="35" ts="1691114579605" s="true" 
lb="T00_HomePage_${variable_name}" rc="200" rm="OK" tn="Thread Group 1-1" 
dt="text" by="1591" sby="109" ng="1" na="1">
     <responseData class="java.lang.String">&lt;!doctype html&gt;
   &lt;html&gt;
   &lt;head&gt;
       &lt;title&gt;Example Domain&lt;/title&gt;
   
       &lt;meta charset=&quot;utf-8&quot; /&gt;
       &lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; 
charset=utf-8&quot; /&gt;
       &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, 
initial-scale=1&quot; /&gt;
       &lt;style type=&quot;text/css&quot;&gt;
       body {
           background-color: #f0f0f2;
           margin: 0;
           padding: 0;
           font-family: -apple-system, system-ui, BlinkMacSystemFont, 
&quot;Segoe UI&quot;, &quot;Open Sans&quot;, &quot;Helvetica Neue&quot;, 
Helvetica, Arial, sans-serif;
           
       }
       div {
           width: 600px;
           margin: 5em auto;
           padding: 2em;
           background-color: #fdfdff;
           border-radius: 0.5em;
           box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
       }
       a:link, a:visited {
           color: #38488f;
           text-decoration: none;
       }
       @media (max-width: 700px) {
           div {
               margin: 0 auto;
               width: auto;
           }
       }
       &lt;/style&gt;    
   &lt;/head&gt;
   
   &lt;body&gt;
   &lt;div&gt;
       &lt;h1&gt;Example Domain&lt;/h1&gt;
       &lt;p&gt;This domain is for use in illustrative examples in documents. 
You may use this
       domain in literature without prior coordination or asking for 
permission.&lt;/p&gt;
       &lt;p&gt;&lt;a 
href=&quot;https://www.iana.org/domains/example&quot;&gt;More 
information...&lt;/a&gt;&lt;/p&gt;
   &lt;/div&gt;
   &lt;/body&gt;
   &lt;/html&gt;
   </responseData>
     <cookies class="java.lang.String"></cookies>
     <method class="java.lang.String">GET</method>
     <queryString class="java.lang.String"></queryString>
     <java.net.URL>http://example.com/</java.net.URL>
   </httpSample>
   <httpSample t="18" it="0" lt="18" ct="0" ts="1691114580766" s="true" 
lb="T00_HomePage_${variable_name}" rc="200" rm="OK" tn="Thread Group 1-1" 
dt="text" by="1591" sby="109" ng="1" na="1">
     <responseData class="java.lang.String">&lt;!doctype html&gt;
   &lt;html&gt;
   &lt;head&gt;
       &lt;title&gt;Example Domain&lt;/title&gt;
   
       &lt;meta charset=&quot;utf-8&quot; /&gt;
       &lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; 
charset=utf-8&quot; /&gt;
       &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, 
initial-scale=1&quot; /&gt;
       &lt;style type=&quot;text/css&quot;&gt;
       body {
           background-color: #f0f0f2;
           margin: 0;
           padding: 0;
           font-family: -apple-system, system-ui, BlinkMacSystemFont, 
&quot;Segoe UI&quot;, &quot;Open Sans&quot;, &quot;Helvetica Neue&quot;, 
Helvetica, Arial, sans-serif;
           
       }
       div {
           width: 600px;
           margin: 5em auto;
           padding: 2em;
           background-color: #fdfdff;
           border-radius: 0.5em;
           box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
       }
       a:link, a:visited {
           color: #38488f;
           text-decoration: none;
       }
       @media (max-width: 700px) {
           div {
               margin: 0 auto;
               width: auto;
           }
       }
       &lt;/style&gt;    
   &lt;/head&gt;
   
   &lt;body&gt;
   &lt;div&gt;
       &lt;h1&gt;Example Domain&lt;/h1&gt;
       &lt;p&gt;This domain is for use in illustrative examples in documents. 
You may use this
       domain in literature without prior coordination or asking for 
permission.&lt;/p&gt;
       &lt;p&gt;&lt;a 
href=&quot;https://www.iana.org/domains/example&quot;&gt;More 
information...&lt;/a&gt;&lt;/p&gt;
   &lt;/div&gt;
   &lt;/body&gt;
   &lt;/html&gt;
   </responseData>
     <cookies class="java.lang.String"></cookies>
     <method class="java.lang.String">GET</method>
     <queryString class="java.lang.String"></queryString>
     <java.net.URL>http://example.com/</java.net.URL>
   </httpSample>
   
   </testResults>
   ```
   
   ### Actual behavior
   
   `Use Expression` feature in certain checkboxes in JMeter not evaluating 
`${__P(property_name)}` and `${variable_name}` value in GUI and CLI.
   
   
   ### Steps to reproduce the problem
   
   1. Create a simple test plan with one HTTP sampler.
   2. In `Test Plan` element, right click on `Functional Test Mode` and select 
`Use Expression` as shown below.
   
   
![image](https://github.com/apache/jmeter/assets/2826376/35487066-7cfe-462a-a2bf-806243854d7a)
   3. Add `${__P(func_mode)}` in the editable checkbox field.
   
   
![image](https://github.com/apache/jmeter/assets/2826376/cfcb6193-8e66-4d73-a391-a013623ed585)
   
   4. Save the test plan.
   5. Add the following property in `jmeter.properties`
   `jmeter.save.saveservice.output_format=xml`
   6. Launch the command prompt.
   7. Run the script with the below arguments.
   
   `jmeter.bat -n -t .\use-expression-checkboxes-demo.jmx -f -l run.xml 
-Jfunc_mode=true`
   8. Once the test is done. Open the run.xml.
   9. It should have detailed response data. But it contains only the basic 
info.
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <testResults version="1.2">
   <httpSample t="66" it="0" lt="62" ct="40" ts="1691113938503" s="true" 
lb="T00_HomePage_${variable_name}" rc="200" rm="OK" tn="Thread Group 1-1" 
dt="text" by="1591" sby="109" ng="1" na="1">
     <java.net.URL>http://example.com/</java.net.URL>
   </httpSample>
   <httpSample t="17" it="0" lt="17" ct="0" ts="1691113939618" s="true" 
lb="T00_HomePage_${variable_name}" rc="200" rm="OK" tn="Thread Group 1-1" 
dt="text" by="1591" sby="109" ng="1" na="1">
     <java.net.URL>http://example.com/</java.net.URL>
   </httpSample>
   
   </testResults>
   ```
   
   Sample observation for `${variable_name}` as well. But `true` or `false` is 
working fine as it is enabling/disabling the mode.
   
   ### JMeter Version
   
   5.6.2
   
   ### Java Version
   
   openjdk version "11" 2018-09-25
   
   ### OS Version
   
   Windows 11 22H2 22621.2070


-- 
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-unsubscr...@jmeter.apache.org.apache.org

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

Reply via email to