You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Doxa <Ik...@gmail.com> on 2011/04/30 16:21:21 UTC

Redirects and embedded objects

Hi,

To optimize my JMeter script I have played with two options in the HTTP
sampler:
(1) Retrieve all embedded resources from HTML files.
I expect that with this option my script will be more independent from
future changes made on some website resources. And I do not have to add the
HTTP samplers to retrieve the resources, which makes my JMeter script a lot
shorter.
(2) Follow redirects.
This will limit the number of HTTP samplers.

With the second option I get an error message (exceeded maximum number of
redirects: 5). I know how to increase the maximum number of redirects, but I
not sure whether this is the right way to handle this. 

 Please let me know what you think about my thoughts. And if you have other
or better ideas how to optimize Jmeter scripts, please share them with us.
D.--
View this message in context: http://jmeter.512774.n5.nabble.com/Redirects-and-embedded-objects-tp4361220p4361220.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Redirects and embedded objects

Posted by sebb <se...@gmail.com>.
On 2 May 2011 20:25, Doxa <Ik...@gmail.com> wrote:
> Felix, thnx for your reply.
>
> After reading your reply I had another look at JMeter. My findings:
>
> (1) Follow redirects: I used the proxy server to capture all requests. I
> copied some requests as a test and checked the follow redirects checkbox.
> When running the test, the replies are different from the recorded ones. I
> only get more redirects as reply, instead of meaningful HTML reply. The
> listener in the proxy server did show meaningful HTML replies. Because of
> all the redirects, I got the same error message (but now after 20
> redirects). How come?

Have you added a Cookie Manager?

> (2) Retrieve all embedded resources from HTML files: in the listener there
> were no requests to retrieve ScriptResources, WebResources, gif's, etc. May
> be this is a logical consequence of all the redirects I got in (1).
>
> D.
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Redirects-and-embedded-objects-tp4361220p4365520.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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


Re: Redirects and embedded objects

Posted by Doxa <Ik...@gmail.com>.
Hmmm, stupid mistake ... indeed I forgot the cookie manager. 

Now, I click on some of the links of my SUT and have JMeter's proxyserver
record all the HTTP requests. In the View Result Tree listener I get a quite
long list of recorded HTTP requets. Some of these requests are the direct
consequence of my click actions and some of them are redirects or resources.
If I want to use the 'Retrieve All Embedded Resources from HTML Files' and
'Follow redirects' options, I have to get only the relevant HTTP requests.
How can I select the relevant HTTP requests that have to be added to my
test?

D.

--
View this message in context: http://jmeter.512774.n5.nabble.com/Redirects-and-embedded-objects-tp4361220p4385320.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Redirects and embedded objects

Posted by Felix Frank <ff...@mpexnet.de>.
> Embedded resources should show up as sub-samples of the main sample,
> and will be visible in the View Results Tree listener.

Right of course. Sorry for sharing foggy memories.

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


Re: Redirects and embedded objects

Posted by sebb <se...@gmail.com>.
On 3 May 2011 08:27, Felix Frank <ff...@mpexnet.de> wrote:
> On 05/02/2011 09:25 PM, Doxa wrote:
>> Felix, thnx for your reply.
>>
>> After reading your reply I had another look at JMeter. My findings:
>>
>> (1) Follow redirects: I used the proxy server to capture all requests. I
>> copied some requests as a test and checked the follow redirects checkbox.
>> When running the test, the replies are different from the recorded ones. I
>> only get more redirects as reply, instead of meaningful HTML reply. The
>> listener in the proxy server did show meaningful HTML replies. Because of
>> all the redirects, I got the same error message (but now after 20
>> redirects). How come?
>
> If you're on Windows, you can use "Fiddler" to examine the requests and
> compare with what the browser sends.
>
> Sebb's remark about Cookie Manager sounds promising.
>
>> (2) Retrieve all embedded resources from HTML files: in the listener there
>> were no requests to retrieve ScriptResources, WebResources, gif's, etc. May
>> be this is a logical consequence of all the redirects I got in (1).
>
> No. The embedded resources do *not* show up in any Listener. Instead,

Embedded resources should show up as sub-samples of the main sample,
and will be visible in the View Results Tree listener.

> the Sampler result aggregates all requests for all content. I.e., if
> Jmeter takes 2 more seconds to fetch the 200 images on a page, your
> Listener will report that the page under test takes two more seconds to
> load (the penalty can be rather high, because Jmeter will not load
> resources concurrently as a browser does).
>
> You may or may not want that. There is no way for Jmeter to
> automatically retrieve embedded content but not report the summed up
> time (unless I'm unaware of some new Listener and/or Plugin trickery).

You can find out the initial page load time from the sample tree (in
View Results Tree listener, and from the JTL results file if using XML
format).

The Cache Manager may be useful here.

> HTH,
> Felix
>
> ---------------------------------------------------------------------
> 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


Re: Redirects and embedded objects

Posted by Felix Frank <ff...@mpexnet.de>.
On 05/02/2011 09:25 PM, Doxa wrote:
> Felix, thnx for your reply. 
> 
> After reading your reply I had another look at JMeter. My findings:
> 
> (1) Follow redirects: I used the proxy server to capture all requests. I
> copied some requests as a test and checked the follow redirects checkbox.
> When running the test, the replies are different from the recorded ones. I
> only get more redirects as reply, instead of meaningful HTML reply. The
> listener in the proxy server did show meaningful HTML replies. Because of
> all the redirects, I got the same error message (but now after 20
> redirects). How come? 

If you're on Windows, you can use "Fiddler" to examine the requests and
compare with what the browser sends.

Sebb's remark about Cookie Manager sounds promising.

> (2) Retrieve all embedded resources from HTML files: in the listener there
> were no requests to retrieve ScriptResources, WebResources, gif's, etc. May
> be this is a logical consequence of all the redirects I got in (1). 

No. The embedded resources do *not* show up in any Listener. Instead,
the Sampler result aggregates all requests for all content. I.e., if
Jmeter takes 2 more seconds to fetch the 200 images on a page, your
Listener will report that the page under test takes two more seconds to
load (the penalty can be rather high, because Jmeter will not load
resources concurrently as a browser does).

You may or may not want that. There is no way for Jmeter to
automatically retrieve embedded content but not report the summed up
time (unless I'm unaware of some new Listener and/or Plugin trickery).

HTH,
Felix

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


Re: Redirects and embedded objects

Posted by Doxa <Ik...@gmail.com>.
Felix, thnx for your reply. 

After reading your reply I had another look at JMeter. My findings:

(1) Follow redirects: I used the proxy server to capture all requests. I
copied some requests as a test and checked the follow redirects checkbox.
When running the test, the replies are different from the recorded ones. I
only get more redirects as reply, instead of meaningful HTML reply. The
listener in the proxy server did show meaningful HTML replies. Because of
all the redirects, I got the same error message (but now after 20
redirects). How come? 

(2) Retrieve all embedded resources from HTML files: in the listener there
were no requests to retrieve ScriptResources, WebResources, gif's, etc. May
be this is a logical consequence of all the redirects I got in (1). 

D.

--
View this message in context: http://jmeter.512774.n5.nabble.com/Redirects-and-embedded-objects-tp4361220p4365520.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Redirects and embedded objects

Posted by Felix Frank <ff...@mpexnet.de>.
On 04/30/2011 04:21 PM, Doxa wrote:
> Hi,
> 
> To optimize my JMeter script I have played with two options in the HTTP
> sampler:
> (1) Retrieve all embedded resources from HTML files.
> I expect that with this option my script will be more independent from
> future changes made on some website resources. And I do not have to add the
> HTTP samplers to retrieve the resources, which makes my JMeter script a lot
> shorter.

Hi,

adding static resources as Samplers is discouraged, anyway:
http://jakarta.apache.org/jmeter/usermanual/best-practices.html#lean_mean

So you're on the right track here.

> (2) Follow redirects.
> This will limit the number of HTTP samplers.
> 
> With the second option I get an error message (exceeded maximum number of
> redirects: 5). I know how to increase the maximum number of redirects, but I
> not sure whether this is the right way to handle this. 
> 
>  Please let me know what you think about my thoughts. And if you have other
> or better ideas how to optimize Jmeter scripts, please share them with us.

If your application requires more than 5 redirects of the same requests,
you should allow that by all means.

This could also mean that there's something funny going on, so you I
suggest you carefully check whether Jmeter is doing the right thing.

Regards,
Felix

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