You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by tgv amni <tg...@gmail.com> on 2014/02/19 19:12:17 UTC

sending a parameter in the GET request

Hi
I have a variable called webSessionId, which holds a websocket session id.
I need to append this value to a websocket request:

In the websocket sampler (I am using a plugin from github for the websocket
protocol) I appended the variable name to path like so:

path: /socket.io/1/websocket/$webSessionId$

Is this the right way to do it ? The goal is to pass the websocket session
id  along with the request..
for e.g
 GET /socket.io/1/websocket/qp4KB2geQNu9vS-MMmYy

This websocket request fails when replaying. Debug sampler shows the
variable has the right value. In view results tree, I do not see the actual
request for this request. Request tab is empty. Sampler Results tab shows
response code as 200 - no helpful message there..

my application server logs show the following:
...
info: handshake authorized qp4KB2geQNu9vS-MMmYy
debug: setting request GET /socket.io/1/websocket/$webSessionId$
debug: set heartbeat interval for client $webSessionId$
debug: websocket writing 7:::1+0
warn: client not handshaken client should reconnect
info: transport end (error)
debug: set close timeout for client $webSessionId$
...
...

Wondering if the way I parameterized the request was correct or not.

thanks.

Re: sending a parameter in the GET request

Posted by tgv amni <tg...@gmail.com>.
I tried adding the braces but it did not help.
Thanks.



On Wed, Feb 19, 2014 at 1:41 PM, Ronny Roscher <di...@gmail.com> wrote:

> Have you tried to use ${webSessionId} instead of $webSessionId$
>
> That's the normal way of using variables.
>
> Ronny
> Am 19.02.2014 19:20 schrieb "tgv amni" <tg...@gmail.com>:
>
> > This is what I see in the debug sampler response data tab:
> >
> > JMeterVariables:
> > JMeterThread.last_sample_ok=false
> > JMeterThread.pack=org.apache.jmeter.threads.SamplePackage@59ada21c
> > START.HMS=113017
> > START.MS=1392827417638
> > START.YMD=20140219
> > TESTSTART.MS=1392832335405
> > tokenVal=f7040153-b8ca-471e-ab1b-3d7060d167fb
> > webSessionId=qp4KB2geQNu9vS-MMmYy
> > webSessionId_g=1
> > webSessionId_g0=qp4KB2geQNu9vS-MMmYy:60:60
> > webSessionId_g1=qp4KB2geQNu9vS-MMmYy
> >
> > I used a regular expression extractor to extract the value for
> > webSessionId, from the response body of a previous socket.io request in
> > the
> > test..
> > I used template as $1$ and match number as 1.
> >
> > Thanks.
> >
> >
> >
> >
> > On Wed, Feb 19, 2014 at 1:12 PM, tgv amni <tg...@gmail.com> wrote:
> >
> > > Hi
> > > I have a variable called webSessionId, which holds a websocket session
> > id.
> > > I need to append this value to a websocket request:
> > >
> > > In the websocket sampler (I am using a plugin from github for the
> > > websocket protocol) I appended the variable name to path like so:
> > >
> > > path: /socket.io/1/websocket/$webSessionId$
> > >
> > > Is this the right way to do it ? The goal is to pass the websocket
> > session
> > > id  along with the request..
> > > for e.g
> > >  GET /socket.io/1/websocket/qp4KB2geQNu9vS-MMmYy
> > >
> > > This websocket request fails when replaying. Debug sampler shows the
> > > variable has the right value. In view results tree, I do not see the
> > actual
> > > request for this request. Request tab is empty. Sampler Results tab
> shows
> > > response code as 200 - no helpful message there..
> > >
> > > my application server logs show the following:
> > > ...
> > > info: handshake authorized qp4KB2geQNu9vS-MMmYy
> > > debug: setting request GET /socket.io/1/websocket/$webSessionId$
> > > debug: set heartbeat interval for client $webSessionId$
> > > debug: websocket writing 7:::1+0
> > > warn: client not handshaken client should reconnect
> > > info: transport end (error)
> > > debug: set close timeout for client $webSessionId$
> > > ...
> > > ...
> > >
> > > Wondering if the way I parameterized the request was correct or not.
> > >
> > > thanks.
> > >
> >
>

Re: sending a parameter in the GET request

Posted by Ronny Roscher <di...@gmail.com>.
Have you tried to use ${webSessionId} instead of $webSessionId$

That's the normal way of using variables.

Ronny
Am 19.02.2014 19:20 schrieb "tgv amni" <tg...@gmail.com>:

> This is what I see in the debug sampler response data tab:
>
> JMeterVariables:
> JMeterThread.last_sample_ok=false
> JMeterThread.pack=org.apache.jmeter.threads.SamplePackage@59ada21c
> START.HMS=113017
> START.MS=1392827417638
> START.YMD=20140219
> TESTSTART.MS=1392832335405
> tokenVal=f7040153-b8ca-471e-ab1b-3d7060d167fb
> webSessionId=qp4KB2geQNu9vS-MMmYy
> webSessionId_g=1
> webSessionId_g0=qp4KB2geQNu9vS-MMmYy:60:60
> webSessionId_g1=qp4KB2geQNu9vS-MMmYy
>
> I used a regular expression extractor to extract the value for
> webSessionId, from the response body of a previous socket.io request in
> the
> test..
> I used template as $1$ and match number as 1.
>
> Thanks.
>
>
>
>
> On Wed, Feb 19, 2014 at 1:12 PM, tgv amni <tg...@gmail.com> wrote:
>
> > Hi
> > I have a variable called webSessionId, which holds a websocket session
> id.
> > I need to append this value to a websocket request:
> >
> > In the websocket sampler (I am using a plugin from github for the
> > websocket protocol) I appended the variable name to path like so:
> >
> > path: /socket.io/1/websocket/$webSessionId$
> >
> > Is this the right way to do it ? The goal is to pass the websocket
> session
> > id  along with the request..
> > for e.g
> >  GET /socket.io/1/websocket/qp4KB2geQNu9vS-MMmYy
> >
> > This websocket request fails when replaying. Debug sampler shows the
> > variable has the right value. In view results tree, I do not see the
> actual
> > request for this request. Request tab is empty. Sampler Results tab shows
> > response code as 200 - no helpful message there..
> >
> > my application server logs show the following:
> > ...
> > info: handshake authorized qp4KB2geQNu9vS-MMmYy
> > debug: setting request GET /socket.io/1/websocket/$webSessionId$
> > debug: set heartbeat interval for client $webSessionId$
> > debug: websocket writing 7:::1+0
> > warn: client not handshaken client should reconnect
> > info: transport end (error)
> > debug: set close timeout for client $webSessionId$
> > ...
> > ...
> >
> > Wondering if the way I parameterized the request was correct or not.
> >
> > thanks.
> >
>

Re: sending a parameter in the GET request

Posted by tgv amni <tg...@gmail.com>.
This is what I see in the debug sampler response data tab:

JMeterVariables:
JMeterThread.last_sample_ok=false
JMeterThread.pack=org.apache.jmeter.threads.SamplePackage@59ada21c
START.HMS=113017
START.MS=1392827417638
START.YMD=20140219
TESTSTART.MS=1392832335405
tokenVal=f7040153-b8ca-471e-ab1b-3d7060d167fb
webSessionId=qp4KB2geQNu9vS-MMmYy
webSessionId_g=1
webSessionId_g0=qp4KB2geQNu9vS-MMmYy:60:60
webSessionId_g1=qp4KB2geQNu9vS-MMmYy

I used a regular expression extractor to extract the value for
webSessionId, from the response body of a previous socket.io request in the
test..
I used template as $1$ and match number as 1.

Thanks.




On Wed, Feb 19, 2014 at 1:12 PM, tgv amni <tg...@gmail.com> wrote:

> Hi
> I have a variable called webSessionId, which holds a websocket session id.
> I need to append this value to a websocket request:
>
> In the websocket sampler (I am using a plugin from github for the
> websocket protocol) I appended the variable name to path like so:
>
> path: /socket.io/1/websocket/$webSessionId$
>
> Is this the right way to do it ? The goal is to pass the websocket session
> id  along with the request..
> for e.g
>  GET /socket.io/1/websocket/qp4KB2geQNu9vS-MMmYy
>
> This websocket request fails when replaying. Debug sampler shows the
> variable has the right value. In view results tree, I do not see the actual
> request for this request. Request tab is empty. Sampler Results tab shows
> response code as 200 - no helpful message there..
>
> my application server logs show the following:
> ...
> info: handshake authorized qp4KB2geQNu9vS-MMmYy
> debug: setting request GET /socket.io/1/websocket/$webSessionId$
> debug: set heartbeat interval for client $webSessionId$
> debug: websocket writing 7:::1+0
> warn: client not handshaken client should reconnect
> info: transport end (error)
> debug: set close timeout for client $webSessionId$
> ...
> ...
>
> Wondering if the way I parameterized the request was correct or not.
>
> thanks.
>

Re: sending a parameter in the GET request

Posted by ZK <st...@gmail.com>.
Hi,
try:
/socket.io/1/websocket/${webSessionId}



ZK



--
View this message in context: http://jmeter.512774.n5.nabble.com/sending-a-parameter-in-the-GET-request-tp5719379p5719385.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