jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: How to force the port to be used in an HTTP Sampler?
Date Tue, 20 Nov 2012 16:56:07 GMT
I'd be very surprised if you need the port in the url - what makes you
think that?
On Nov 20, 2012 4:59 AM, "Taoism" <youngka@gmail.com> wrote:

> The port is specified in the HTTP Sampler.  As is that the protocol is
> HTTPS.
>
> The problem is that the "Location:" header includes both HTTPS and :443 in
> the redirect URL and that the receiving server apparently expects that :443
> will be part of the URL even though it is implied by HTTPS (since 443 is
> the
> default port for HTTPS).
>
> Thus in a BeanShell PostProcessor (in sampler that just ran) or in a
> BeanShell PreProcessor (in the next sampler) this happens:
>
> +-Sampler A
> -+-BSH PostProcessor A
> +-Sampler B
> -+-BSH PreProcessor B
>
> Sampler A and B both have the port set to 443 and the protocol to HTTPS.
> The domain is set in the sampler as well as the path.  Previously I was
> dynamically grabbing the redirect location and building it up dynamically
> in
> a preprocessor for the next sampler.  However, to try and solve this
> problem
> I have reverted to hardcoding the values into the sampler fields.  The
> problem is when Sampler B executes, it doesn't add the port to the URL:
>
> //BSH PostProcessor A
> url = prev.getRedirectLocation();
> //url is: 'https://domain:443/blah/SSO?qsStuff'
>
> //BSH PreProcessor B
> url = sampler.getUrl()
> //url is now 'https://domain/blah/SSO?qsStuff'
>
> So, the sampler when building the URL is leaving out the port.  I assume it
> is leaving it out because specifying port 443 AND HTTPS is redundant.
>
> I have looked through the API thought using the path as the whole URL may
> work:
>
> http://jmeter.apache.org/api/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.html#getUrl()
> "As a special case, if the path starts with "http[s]://", then the path is
> assumed to be the entire URL."
>
> However, calling setPath() automatically calls parseArguments() and I lose
> the query string component.
>
> http://jmeter.apache.org/api/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.html#setPath(java.lang.String)
> "Sets the Path attribute of the UrlConfig object Also calls parseArguments
> to extract and store any query arguments"
>
> Which removes that as a possibility....
>
>
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/How-to-force-the-port-to-be-used-in-an-HTTP-Sampler-tp5715344p5715360.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message