Discussion:
HTTP Request Defaults & Header Manager
Onl
2015-07-28 20:59:16 UTC
Permalink
Hi,
We are using the test script recorder to create the test plan, and added a http request default to set the servername and port #. The 'capture http headers' is turned on.

But the referer field in the captured http header manager still has a hardcoded server name and port #. How can we fix this?
Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@jmeter.apache.org
For additional commands, e-mail: user-***@jmeter.apache.org
Felix Schumacher
2015-07-29 05:35:56 UTC
Permalink
Post by Onl
Hi,
We are using the test script recorder to create the test plan, and
added a http request default to set the servername and port #. The
'capture http headers' is turned on.
But the referer field in the captured http header manager still has a
hardcoded server name and port #. How can we fix this?
Before you record your script you can define "user defined variables" which represent your server name. Jmeter will then replace every occurence of the server bane in the recorded samplers by the name of the variable. That includes http headers.

For more infos see http://jmeter.apache.org/usermanual/best-practices.html#proxy_server

If you have already recorded the script, you can replace the server name in the http headers config by hand. They can probably be found below every http sampler.

Regards,
Felix
Post by Onl
Thanks.
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@jmeter.apache.org
For additional commands, e-mail: user-***@jmeter.apache.org
Onl
2015-07-29 15:04:26 UTC
Permalink
Thanks for input. Perhaps I am missing something.

The http request samplers are working out fine, in that the "server name" and "port number" are blank, and at playback time the http request default values are used.

However, the HTTP Header Managers (under each http request sampler), are still hard-coding the server name and port number in the Referer field.

I don't think I can have a default HTTP Header Manager since not every http request sampler has the same sampler.
EG:
some header managers have: Referer: http://myserver:8080/mypath/initiallogon
some header managers have: Referer: http://myserver:8080/mypath/homebase
some header managers have: Referer: http://myserver:8080/mypath/bypass

So when recording the test using the proxy, how can we tell jmeter to parameterize the server and port in the http header manager referer value, but still capture the unique portion of the referer value? What do I define, where is it defined and where is it replaced?
The goal is to playback on any environment.

Thank you.
Post by Felix Schumacher
Post by Onl
Hi,
We are using the test script recorder to create the test plan, and
added a http request default to set the servername and port #. The
'capture http headers' is turned on.
But the referer field in the captured http header manager still has a
hardcoded server name and port #. How can we fix this?
Before you record your script you can define "user defined variables" which represent your server name. Jmeter will then replace every occurence of the server bane in the recorded samplers by the name of the variable. That includes http headers.
For more infos see http://jmeter.apache.org/usermanual/best-practices.html#proxy_server
If you have already recorded the script, you can replace the server name in the http headers config by hand. They can probably be found below every http sampler.
Regards,
Felix
Post by Onl
Thanks.
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@jmeter.apache.org
For additional commands, e-mail: user-***@jmeter.apache.org
Felix Schumacher
2015-07-29 19:02:35 UTC
Permalink
Post by Onl
Thanks for input. Perhaps I am missing something.
The http request samplers are working out fine, in that the "server name" and "port number" are blank, and at playback time the http request default values are used.
However, the HTTP Header Managers (under each http request sampler), are still hard-coding the server name and port number in the Referer field.
I don't think I can have a default HTTP Header Manager since not every http request sampler has the same sampler.
some header managers have: Referer: http://myserver:8080/mypath/initiallogon
some header managers have: Referer: http://myserver:8080/mypath/homebase
some header managers have: Referer: http://myserver:8080/mypath/bypass
So when recording the test using the proxy, how can we tell jmeter to parameterize the server and port in the http header manager referer value, but still capture the unique portion of the referer value? What do I define, where is it defined and where is it replaced?
The goal is to playback on any environment.
I think the proxy recorder will add a header manager to each sampler and
will thus be able to add an individual refererer to each header manager.

If you define a user defined variable (as described in the link I
provided) jmeter could replace the string "myserver" with a variable in
those header managers.

Regards,
Felix
Post by Onl
Thank you.
Post by Felix Schumacher
Post by Onl
Hi,
We are using the test script recorder to create the test plan, and
added a http request default to set the servername and port #. The
'capture http headers' is turned on.
But the referer field in the captured http header manager still has a
hardcoded server name and port #. How can we fix this?
Before you record your script you can define "user defined variables" which represent your server name. Jmeter will then replace every occurence of the server bane in the recorded samplers by the name of the variable. That includes http headers.
For more infos see http://jmeter.apache.org/usermanual/best-practices.html#proxy_server
If you have already recorded the script, you can replace the server name in the http headers config by hand. They can probably be found below every http sampler.
Regards,
Felix
Post by Onl
Thanks.
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@jmeter.apache.org
For additional commands, e-mail: user-***@jmeter.apache.org

Continue reading on narkive:
Loading...