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:53:41 GMT
Oops  I misread the response -Yes you'd need two samplers
On Nov 19, 2012 4:35 PM, "David Luu" <mangaroo@gmail.com> wrote:

> Just wanted to clarify Deepak, with the suggested (2 sampler) approach, one
> needs to turn off follow redirects in sampler 1 right? And we just parse
> out the location header in the response instead and proceed with sampler 2
> that simulates the redirect.
>
> On Mon, Nov 19, 2012 at 3:41 PM, Deepak Shetty <shettyd@gmail.com> wrote:
>
> > HTTPSampler1
> > +Regex Post Processor to extract out location header into variable
> > +BSH post processor - read port put in defaults etc if needed
> > HTTPSampler2 ${url}, ${port}
> >
> >
> > regards
> > deepak
> >
> >
> >
> >
> > On Mon, Nov 19, 2012 at 3:31 PM, David Luu <mangaroo@gmail.com> wrote:
> >
> > > But how do you use dynamic value for port if you get port value from
> > > redirect? Right now it's 443, but it's possible that could change in
> the
> > > future. As Scott mentioned, you could extract from headers but that
> would
> > > make it two requests to work?
> > >
> > > Assuming the port won't change from 443, I assume you could do a
> dynamic
> > > condition if/else check if protocol is HTTP vs HTTPS and if the latter,
> > set
> > > to port 443 otherwise 80, but how would you write that? And would that
> > only
> > > work for original request or will it also do a 2nd lookup/check against
> > the
> > > new redirected URL when original request is made?
> > >
> > > On Mon, Nov 19, 2012 at 2:48 PM, Deepak Shetty <shettyd@gmail.com>
> > wrote:
> > >
> > > > two samplers arent needed - you could use dynamic values in the port
> > > field
> > > > (not tested in latest versions)
> > > >
> > > > ${__property(run.server.port,,80)}
> > > >
> > > >
> > > > On Mon, Nov 19, 2012 at 2:33 PM, HUSSEY, SCOTT T <sh8121@att.com>
> > wrote:
> > > >
> > > > > You could build two different samplers and extract the redirect
> from
> > > the
> > > > > header if the address is dynamic.
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: David Luu [mailto:mangaroo@gmail.com]
> > > > > > Sent: Monday, November 19, 2012 4:27 PM
> > > > > > To: JMeter Users List
> > > > > > Subject: Re: How to force the port to be used in an HTTP Sampler?
> > > > > >
> > > > > > It's not totally clear from the original email, but I'm assuming
> > the
> > > > > > sampler was originally requesting an HTTP url on port 80
> (specified
> > > > > > specifically in port field or left at default).
> > > > > >
> > > > > > And the result of the request causes a redirect to HTTPS with
> > > specific
> > > > > > addition of port 443 in URL, and that the HTTP sampler simply
> > follows
> > > > the
> > > > > > redirect to HTTPS at given URL but doesn't append port 443,
> causing
> > > the
> > > > > > failure.
> > > > > >
> > > > > > If you manually set port to 443 in the port field for the
> sampler,
> > > > > wouldn't
> > > > > > that cause the original request to change from
> > > > > >
> > > > > > http://originalUrl
> > > > > >
> > > > > > to
> > > > > >
> > > > > > http://originalUrl:443
> > > > > >
> > > > > > which could then cause a problem w/o redirecting, because server
> is
> > > > > > expecting port 80 instead at this point of the process? But
of
> > > course,
> > > > if
> > > > > > the original URL was already HTTPS and on 443 (default) then
that
> > > > > wouldn't
> > > > > > be a problem.
> > > > > >
> > > > > > On Mon, Nov 19, 2012 at 11:11 AM, sebb <sebbaz@gmail.com>
wrote:
> > > > > >
> > > > > > > On 19 November 2012 18:18, Taoism <youngka@gmail.com>
wrote:
> > > > > > > > Hi all,
> > > > > > > >
> > > > > > > > I am having an issue with a SSO system.
> > > > > > > >
> > > > > > > > If I do a recording following redirects at one point
the
> system
> > > > > sends a
> > > > > > > > response headers with a redirect URL like so:
> > > > > > > >
> > > > > > > > https://domain:443/blah/SSO?qsStuff
> > > > > > > >
> > > > > > > > (Note the use of both https and the default 443 port
in the
> > URL).
> > > > > > > >
> > > > > > > > The HTTP Sampler will not add the 443 to the URL being
sent
> to
> > > the
> > > > > next
> > > > > > > > server (personally I don't think it should have to).
 If the
> > port
> > > > is
> > > > > > > omitted
> > > > > > > > and just https://domain/blah is used I get an Internal
error
> > > from
> > > > > the
> > > > > > > > server.  Adding the port allows the SSO process to
continue.
> > > > > (Discovered
> > > > > > > by
> > > > > > > > manually copying the response redirect and pasting
into a
> > > browser).
> > > > > > > >
> > > > > > > > Is there any way to force the HTTP Sampler to include
the
> port
> > > when
> > > > > it
> > > > > > > makes
> > > > > > > > the request even though it is technically redundant
in this
> > > > instance?
> > > > > > >
> > > > > > > Just provide the port on the sampler GUI.
> > > > > > >
> > > > > > > > Cheers!
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > View this message in context:
> > > > > > >
> > > http://jmeter.512774.n5.nabble.com/How-to-force-the-port-to-be-used-
> > > > > > in-an-HTTP-Sampler-tp5715344.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
> > > > > > > >
> > > > > > >
> > > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > > > > > > For additional commands, e-mail: user-help@jmeter.apache.org
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > 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