jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: wrong HTTP header in JavaScript URL
Date Fri, 22 Feb 2008 12:29:29 GMT
On 22/02/2008, Tom Fernandes <anyaddress@gmx.net> wrote:
> Hi,
>
>
>  On Thursday, 21. February 2008, sebb wrote:
>  > On 21/02/2008, Tom Fernandes <anyaddress@gmx.net> wrote:
>  > > Hello,
>  > >
>  > >  I'm loading a site (http://foo.bar) through jmeter. This site calls
>  > > (through
>  >
>  > Which version?
>
>
> 2.3.1
>
>
>  >
>  > Which HTTP Sampler? Original or HttpClient?
>
>
> HTTP Sampler
>
>
>  >
>  > >  JavaScript) http://www.google-analytics.com/urchin.js
>  > >
>  > >  This results in a 404 answer from google. I sniffed a manual request to
>  > > this site with my browser and the request done through jmeters proxy. The
>  > > difference is when I request the site from my browser the JavaScript
>  > > request contains the HTTP header "Host: www.google-analytics.com". When
>  > > looking at the HTTP header of request send through jmeter, "Host" is set
>  > > to "foo.bar". This is correct for all the other request but _not_ for
>  > > that JavaScript request.
>  > >  When using the Header Manager I can rewrite all the HTTP headers in the
>  > >  request which is not what I want. I didn't find a way to only re-write
>  > > that request.
>  > >
>  > >  Solution a) re-write the HTTP header of the JS request
>  > >  Solution b) exclude that JS request from being executed
>  > >
>  > >  Any idea how to do either of those? Solution b) would be preferred.
>  >
>  > Just delete the corresponding sampler?
>
>
> I do want to load http://foo.bar I just don't want the JS request to contact
>  google. The corresponding script in the site is:
>
>  <script src="http://www.google-analytics.com/urchin.js"
>  type="text/javascript">
>  </script>
>  <script type="text/javascript">
>  _uacct = "UA-687106-1";
>  urchinTracker("/cars/bm/Index");
>  </script>
>

JMeter will try to download the JS file as an embedded resource.

I'm not sure why it uses the parent page host; that seems to be a bug.

>
>
>  >
>  > If the sampler is automatically generated (using embedded checkbox)
>
>
> In my HTTP Request Default I have "Retrieve All Embedded Resources from HTML
>  Files" checked if that is what you mean.
>

Yes.

>
>  > then use the RE exception field to exclude it.
>

Sorry that was not correct - see below.

>
> I know regexes and have read the chapter in the user manual about how to use
>  them. I is still not clear to me where to put this regex.
>

Sorry, that was misleading, see "Embedded URLs must match"

in

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request

I was thinking of the Proxy config which also has an Exclude field.
However you should be able to use the include field instead.

>
>  Tom
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message