apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.37k stars 2.1k forks source link

Give a way to provide HTTPProxyServer with variables different from those in the Test Plan #1207

Closed asfimport closed 20 years ago

asfimport commented 21 years ago

Brandon Ulrich (Bug 22788): User-defined variables are being automatically inserted into recorded proxy requests when the value from the proxy matches a user-defined value. For example, if I have a value of "8" the port "80" would be recorded as "${myVal} 0".

To reproduce:

  1. Start JMeter
  2. On Test Plan page, add new variable name="myVar" value="8"
  3. Add Thread Group to Test Plan
  4. Add Recording Controller to Thread Group
  5. Add HttpProxyServer to Workbench
  6. Start HttpProxyServer at port 8090
  7. Request http://jakarta.apache.org/jmeter through proxy
  8. Click on /jmeter/ under the Recording Controller
  9. Port number is ${myVar}0 instead of expected 80

OS: Windows XP

asfimport commented 21 years ago

Martin Ramshaw (migrated from Bugzilla): I have confirmed this report, but it doesn't seem to be a bug.

If someone can convince me that this is incorrect behaviour, I'd be prepared to look into it.

asfimport commented 21 years ago

Brandon Ulrich (migrated from Bugzilla): We use a large number of single-digit user variables in our tests; you can image the translated results when we add recorded pages with large number of date and numeric parameters. Our work-around is to create a new Test Plan, record the additional units, and then cut and paste them into the original plan.

If this is intended behavior, instead of a bug, Í'm fine with changing this to an enhancement request that would allow us to deactivate this feature while recording scripts.

It seems there are good reasons to leave it there: The following tip from Jordi to a user recording SSL <jordi> A usually practical way is to:

1/ Create a User Defined Variable in the Test Plan with value "http". Name it, say, "protocol".

2/ Record your script. The proxy will cleverly (sometimes too cleverly) replace every occurence of "http" with ${protocol}.

3/ Change the variable value to https.

4/ Run the script. </jordi>

asfimport commented 20 years ago

Jordi Salvat i Alabart (migrated from Bugzilla): I don't think this is a bug. Instead, we should: 1/ Provide a configuration element to define variables. 2/ Have the proxy use one such element placed directly within the proxy element instead of the variables in the test plan.

1/ would have the additional advantage of allowing selecting different sets of variables by enabling/disabling such components.

Converting this to an enhancement request for these features. Summary was: HTTPProxyServer inserts user-defined Variables instead of actual values

asfimport commented 20 years ago

Jordi Salvat i Alabart (migrated from Bugzilla): I did and documented this a (long) while ago. Check latest CVS code or a nightly build.