jmeter icon indicating copy to clipboard operation
jmeter copied to clipboard

feat: Add checkbox to enable/disable params in HTTP Sampler

Open pochopsp opened this issue 1 year ago • 5 comments

Description

This pull request adds a new column in the HTTP Sampler parameters table which allows the user to enable or disable the http parameter.

To implement this feature, a new "isEnabledFromGui" property has been added in HTTPArgument and it has been used in several places (HTTPHC4Impl, HTTPSamplerBase, PutWriter etc.) to determine whether to include the argument in the request or not. To enable the property setting by the user a new column has been added in HTTPArgumentsPanel. The HTTPArgumentSchema has been adjusted to include this new field too. Tests file and localization files has been adjusted to be compliant with this new attribute.

Motivation and Context

I think this feature could be really useful, because sometimes I and other people I know wished JMeter had it while doing some tests. Fixes https://github.com/apache/jmeter/issues/5466

How Has This Been Tested?

I have successfully built the project by using ./gradlew build and all tests ran without issues. My testing environment is Windows 10, Intel I5 6th gen, 16GB Ram DD4, Oracle JDK 17.

Screenshots (if appropriate):

image image

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • [x ] My code follows the code style of this project.
  • [ ] I have updated the documentation accordingly.

pochopsp avatar Jun 11 '24 22:06 pochopsp

Hi @vlsi could you please help me on that? I don't really have a clue on why these tests are failing...

pochopsp avatar Jun 20 '24 17:06 pochopsp

@vlsi I've also ran on my machine the task :src:dist-check:batchResponseDecompression which is failing in 17, microsoft, windows, America/New_York, tr_TR and it ran successfully image

pochopsp avatar Jun 29 '24 09:06 pochopsp

@pochopsp, have you tried using the default org.apache.jmeter.testelement.TestElementSchema#getEnabled for the attributes? Is there a need for a separate property?

vlsi avatar Nov 01 '24 11:11 vlsi

@vlsi you were right, there is no need for a new property in the HTTArgumentSchema. I updated my pull request with commits including the use of org.apache.jmeter.testelement.TestElementSchema.enabled as you suggested. Furthermore, by doing so the number of edited files decreased to just six.

pochopsp avatar Nov 08 '24 21:11 pochopsp

Looks like the regression tests pass, however, we should add new tests for the disabled arguments.

vlsi avatar Jan 14 '25 17:01 vlsi

Hi @vlsi , just added the tests. Please let me know if there's something else to check.

pochopsp avatar Oct 05 '25 23:10 pochopsp