>Good application also need to see referrer, for example - web statistic :)
True but not strictly needed for a performance / load test right? (unless
this is the bit you are testing out). If you just need some value in this
field (to prevent a server side error) then a HTTP header manager with a
hard coded value should suffice.

Anyway this seems to work

Thread Group
  +HTTP Header manager (Referer = ${Referer})
  +set the initial value of the variable Referer as blank or deal with the
first request differently (for e.g. if you dont want the referer at all) in
wh
  +Simple Controller
      Request 1
      Request 2
      Request 3
      ....
  ++Regular Expression Extractor (as a child of simple controller so that it
applies to all requests)
        Name = Referer (same as the header manager variable)
        Choose URL in the radio button ,
         Expression=(.*)  Template=$1$ (i.e. we get the whole URL)

If you wanted to do the same thing in BSH, you'd probably use
http://jakarta.apache.org/jmeter/api/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.html
getURL

I normally have to refer to the javadocs if I need to know the methods /
objects etc.
regards
deepak



On Tue, Oct 13, 2009 at 4:03 PM, Alexandr <[email protected]> wrote:

> Thanks!
> Good application also need to see referrer, for example - web statistic :)
> Can you advise me a method to read processed url in post-process bsh
> script?
> Or better the link on Domain model of jmeter with BSH script.
>
> 2009/10/14 Deepak Shetty <[email protected]>
>
> > A referer is normally sent by the browser based on the page you were on
> > when
> > you clicked the link (and jmeter isn't a browser). If you absolutely need
> > the referrer to be sent(if you have server code that relies on the
> referrer
> > , the server code is just plain bad , especially if its during security
> > related checks) then you'd probably need to add a HTTP Header manager to
> > your request.
> >
> > If you needed this for each and every request then you might try using a
> > BSH
> > Pre Processor to set the Referrer value into the HeaderManager of the
> HTTP
> > Sample (sampler.getHeaderManager().addHeader(Header)). You'd probably
> also
> > add a post processor to every request that tracks the URL(so that it can
> be
> > added as the referrer).
> >
> > There is no way to do all of this automatically (unless you recorded the
> > script  , in which case the referrer would have got recorded as well) as
> > far
> > as I know
> >
> > regards
> > deepak
> >
> >
> >
> >
> >
> > On Tue, Oct 13, 2009 at 3:41 PM, Alexandr <[email protected]> wrote:
> >
> > > When I run my tests with http samplers I don't see referer in http
> > request
> > > headers. I can't find anything in user manual how to realise it. Cookie
> > > manager controller can track sessions but doesn't track referrers. Why?
> > > Anybody make a referrer traking in their test?
> > >
> > > --
> > > WBR,
> > > Alexandr Sukhov
> > >
> >
>

Reply via email to