You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Sergei Riaguzov <ri...@gmail.com> on 2005/08/10 10:26:04 UTC

follow redirects vs download images

Looks like there's a bug in Jmeter's Http Samplers (both of them). If
"Download Embedded Resources" in true and "Follow Redirects" is true,
then images from the last page in redirect sequence are not
downloaded.

The bug seem to hide somewhere in sample() within the organization of
this block:

if (!areFollowingRedirects)  {
    ...
    followRedirects();
    if (isImageParser) {
          if (some checks for errors)
               ...
          else {
               downloadEmbeddedResources()
               // and this actually happens so everything looks fine
               // but doesn't download image resources (they are not seen in 
               // listeners and so on
          }
        
   }
}

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


Re: follow redirects vs download images

Posted by Sergei Riaguzov <ri...@gmail.com>.
Looks like it is easy to fix. There's a line in 

HttpSampleBase.downloadPageResources():

if (res.getContentType().toLowerCase().indexOf("text/html") != -1)
{
    urls=
                HTMLParser.getParser().getEmbeddedResourceURLs(
                    res.getResponseData(),
                    res.getURL());
}

And that is not happening after followRedirects().

I added this into followRedirects():

        totalRes.setSampleLabel(
            totalRes.getSampleLabel() + "->" + lastRes.getSampleLabel());
          ...........

        // This should fix JMeter's bug with not downloading images
        // after following redirects
        totalRes.setContentType(lastRes.getContentType());

         ..............
        
        return totalRes;

And now it works nicely.




On 8/10/05, Sergei Riaguzov <ri...@gmail.com> wrote:
> Looks like there's a bug in Jmeter's Http Samplers (both of them). If
> "Download Embedded Resources" in true and "Follow Redirects" is true,
> then images from the last page in redirect sequence are not
> downloaded.
> 
> The bug seem to hide somewhere in sample() within the organization of
> this block:
> 
> if (!areFollowingRedirects)  {
>     ...
>     followRedirects();
>     if (isImageParser) {
>           if (some checks for errors)
>                ...
>           else {
>                downloadEmbeddedResources()
>                // and this actually happens so everything looks fine
>                // but doesn't download image resources (they are not seen in
>                // listeners and so on
>           }
> 
>    }
> }
>

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