You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Vikash kumar <vi...@tracesoftware.in> on 2016/03/15 14:11:58 UTC

Recorded scripts are unable to perform login operation while playing in Jmeter.

Hi,

I've recorded some scenarios  including "Login" to my application scenario
 from Jmeter, but while playing the recorded scripts from Jmeter i am
seeing that the user hasn't logged in and is still present at the landing
page only. I have used a 'Tree Listener' and navigated to the request and
opened the "Response Data" tab,  seeing the HTML response of the request
sent and received by JMeter. I've used only one user/thread for my
execution.

Any idea why it's showing like this in the HTML response of "Response Data"
tab in the  'Tree Listener'  listener. Do i need to tweak any change or
something.

Earliest reply is deeply appreciable.

Regards,
Vikash

Re: Recorded scripts are unable to perform login operation while playing in Jmeter.

Posted by Vikash kumar <vi...@tracesoftware.in>.
Thanks Deepak for clarifying all the doubts.

On Wed, Mar 16, 2016 at 11:03 PM, Deepak Shetty <sh...@gmail.com> wrote:

> Hi
> >nd i am using jmeter 9.
> If you mean 2.9 then you should move to later versions
>
> >1) How and where can i check the session id in the recorded scripts,
> Depends - Usually it is a cookie , in which case JMeter will not record it
> in the script . If your application uses url rewriting then it will be
> present in the URL
> >Is the JSessionid is the Session id for this particular execution ?
> Yers - Java based applications usually use JSESSIONID
>
> >3) Also if the session id is different(as shown by the Jmeter) then the
> jmeter should have shown some different Response Data
> JMeter shows whatever the application has returned
> >So is there  some loophole in my system or Jmeter.
> Only someone with knowledge of your application can say. Its possible your
> script is not doing things exactly how the browser is or its possible your
> application has a bug.
>
>
> On Wed, Mar 16, 2016 at 1:37 AM, Vikash kumar <
> vikashkumar@tracesoftware.in>
> wrote:
>
> > Hi Deepak,
> >
> > Thanks for replying, and yes it resolved my issue by adding a cookie
> > manager and i am using jmeter 9. But i still have couple of doubts and
> > really appreciate if you can clear it :
> >
> > 1) How and where can i check the session id in the recorded scripts, i
> > tried to check but unable to get it.
> >
> > 2) Also in the executed scripts(HTTP Response from the server) i can see
> > CookieLocaleResolver.LOCALE=en_US;
> > JSESSIONID=1366802B8E47D6D3A261DD1220A73ABD
> >
> > Is the JSessionid is the Session id for this particular execution ?
> >
> > 3) Also if the session id is different(as shown by the Jmeter) then the
> > jmeter should have shown some different Response Data (Not Response Code
> instead
> > of showing the same response data since my application supports only one
> > user to use that session. So is there  some loophole in my system or
> Jmeter.
> >
> > Regards,
> > Vikash
> >
> >
> > On Tue, Mar 15, 2016 at 11:27 PM, Deepak Shetty <sh...@gmail.com>
> wrote:
> >
> >> Hi
> >> You can record and replay a script and expect it to work only if your
> >> application doesn't use anything dynamic - i.e. a parameter that can
> >> potentially change values with time . This might take on a variety of
> >> things like
> >> a, Security Form tokens (for e.g to prevent request forgeries)
> >> b. timestamps
> >> c. Encrypted values that are used for Single sign on
> >> d. Session ids if your application is using url rewriting
> >> etc.
> >> An easy way to identify this is record the same script twice and check
> for
> >> differences - Parameters that are changing values are dynamic
> >> (Alternately understand how your application works from a dev)
> >>
> >> Once you identify the parameters , then you have to use a Post processor
> >> to
> >> extract values from the response that has these dynamic values into a
> >> variable and then use ${variableName}. The only exception to that is
> >> session id which can *usually* be handled by a cookie manager (assuming
> >> your application supports it) . In rare cases , it is some javascript
> >> executing on your page that is creating the dynamic values - in which
> case
> >> you have to simulate the same in JMeter.
> >>
> >> And you have to use assertions to know if your script is working as
> >> expected or not.
> >>
> >> regards
> >> deepak
> >>
> >>
> >>
> >> On Tue, Mar 15, 2016 at 6:11 AM, Vikash kumar <
> >> vikashkumar@tracesoftware.in>
> >> wrote:
> >>
> >> > Hi,
> >> >
> >> > I've recorded some scenarios  including "Login" to my application
> >> scenario
> >> >  from Jmeter, but while playing the recorded scripts from Jmeter i am
> >> > seeing that the user hasn't logged in and is still present at the
> >> landing
> >> > page only. I have used a 'Tree Listener' and navigated to the request
> >> and
> >> > opened the "Response Data" tab,  seeing the HTML response of the
> request
> >> > sent and received by JMeter. I've used only one user/thread for my
> >> > execution.
> >> >
> >> > Any idea why it's showing like this in the HTML response of "Response
> >> Data"
> >> > tab in the  'Tree Listener'  listener. Do i need to tweak any change
> or
> >> > something.
> >> >
> >> > Earliest reply is deeply appreciable.
> >> >
> >> > Regards,
> >> > Vikash
> >> >
> >>
> >
> >
>

Re: Recorded scripts are unable to perform login operation while playing in Jmeter.

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
>nd i am using jmeter 9.
If you mean 2.9 then you should move to later versions

>1) How and where can i check the session id in the recorded scripts,
Depends - Usually it is a cookie , in which case JMeter will not record it
in the script . If your application uses url rewriting then it will be
present in the URL
>Is the JSessionid is the Session id for this particular execution ?
Yers - Java based applications usually use JSESSIONID

>3) Also if the session id is different(as shown by the Jmeter) then the
jmeter should have shown some different Response Data
JMeter shows whatever the application has returned
>So is there  some loophole in my system or Jmeter.
Only someone with knowledge of your application can say. Its possible your
script is not doing things exactly how the browser is or its possible your
application has a bug.


On Wed, Mar 16, 2016 at 1:37 AM, Vikash kumar <vi...@tracesoftware.in>
wrote:

> Hi Deepak,
>
> Thanks for replying, and yes it resolved my issue by adding a cookie
> manager and i am using jmeter 9. But i still have couple of doubts and
> really appreciate if you can clear it :
>
> 1) How and where can i check the session id in the recorded scripts, i
> tried to check but unable to get it.
>
> 2) Also in the executed scripts(HTTP Response from the server) i can see
> CookieLocaleResolver.LOCALE=en_US;
> JSESSIONID=1366802B8E47D6D3A261DD1220A73ABD
>
> Is the JSessionid is the Session id for this particular execution ?
>
> 3) Also if the session id is different(as shown by the Jmeter) then the
> jmeter should have shown some different Response Data (Not Response Code instead
> of showing the same response data since my application supports only one
> user to use that session. So is there  some loophole in my system or Jmeter.
>
> Regards,
> Vikash
>
>
> On Tue, Mar 15, 2016 at 11:27 PM, Deepak Shetty <sh...@gmail.com> wrote:
>
>> Hi
>> You can record and replay a script and expect it to work only if your
>> application doesn't use anything dynamic - i.e. a parameter that can
>> potentially change values with time . This might take on a variety of
>> things like
>> a, Security Form tokens (for e.g to prevent request forgeries)
>> b. timestamps
>> c. Encrypted values that are used for Single sign on
>> d. Session ids if your application is using url rewriting
>> etc.
>> An easy way to identify this is record the same script twice and check for
>> differences - Parameters that are changing values are dynamic
>> (Alternately understand how your application works from a dev)
>>
>> Once you identify the parameters , then you have to use a Post processor
>> to
>> extract values from the response that has these dynamic values into a
>> variable and then use ${variableName}. The only exception to that is
>> session id which can *usually* be handled by a cookie manager (assuming
>> your application supports it) . In rare cases , it is some javascript
>> executing on your page that is creating the dynamic values - in which case
>> you have to simulate the same in JMeter.
>>
>> And you have to use assertions to know if your script is working as
>> expected or not.
>>
>> regards
>> deepak
>>
>>
>>
>> On Tue, Mar 15, 2016 at 6:11 AM, Vikash kumar <
>> vikashkumar@tracesoftware.in>
>> wrote:
>>
>> > Hi,
>> >
>> > I've recorded some scenarios  including "Login" to my application
>> scenario
>> >  from Jmeter, but while playing the recorded scripts from Jmeter i am
>> > seeing that the user hasn't logged in and is still present at the
>> landing
>> > page only. I have used a 'Tree Listener' and navigated to the request
>> and
>> > opened the "Response Data" tab,  seeing the HTML response of the request
>> > sent and received by JMeter. I've used only one user/thread for my
>> > execution.
>> >
>> > Any idea why it's showing like this in the HTML response of "Response
>> Data"
>> > tab in the  'Tree Listener'  listener. Do i need to tweak any change or
>> > something.
>> >
>> > Earliest reply is deeply appreciable.
>> >
>> > Regards,
>> > Vikash
>> >
>>
>
>

Re: Recorded scripts are unable to perform login operation while playing in Jmeter.

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
You can record and replay a script and expect it to work only if your
application doesn't use anything dynamic - i.e. a parameter that can
potentially change values with time . This might take on a variety of
things like
a, Security Form tokens (for e.g to prevent request forgeries)
b. timestamps
c. Encrypted values that are used for Single sign on
d. Session ids if your application is using url rewriting
etc.
An easy way to identify this is record the same script twice and check for
differences - Parameters that are changing values are dynamic
(Alternately understand how your application works from a dev)

Once you identify the parameters , then you have to use a Post processor to
extract values from the response that has these dynamic values into a
variable and then use ${variableName}. The only exception to that is
session id which can *usually* be handled by a cookie manager (assuming
your application supports it) . In rare cases , it is some javascript
executing on your page that is creating the dynamic values - in which case
you have to simulate the same in JMeter.

And you have to use assertions to know if your script is working as
expected or not.

regards
deepak



On Tue, Mar 15, 2016 at 6:11 AM, Vikash kumar <vi...@tracesoftware.in>
wrote:

> Hi,
>
> I've recorded some scenarios  including "Login" to my application scenario
>  from Jmeter, but while playing the recorded scripts from Jmeter i am
> seeing that the user hasn't logged in and is still present at the landing
> page only. I have used a 'Tree Listener' and navigated to the request and
> opened the "Response Data" tab,  seeing the HTML response of the request
> sent and received by JMeter. I've used only one user/thread for my
> execution.
>
> Any idea why it's showing like this in the HTML response of "Response Data"
> tab in the  'Tree Listener'  listener. Do i need to tweak any change or
> something.
>
> Earliest reply is deeply appreciable.
>
> Regards,
> Vikash
>

Re: Recorded scripts are unable to perform login operation while playing in Jmeter.

Posted by "Srinivasan, Kavya" <Ka...@netapp.com>.
Hi Vikash,

When you have recorded, you would have recorded with a session id.
If you see the script in editplus or see the requests from jmeter only, you can see this session id hard coded somewhere.

Next time when you run the script it wouldn't login as this session is expired.

Here are the steps to resolve.

Record your script
Add a cookie manager to your script
Run the script and see results in tree listener to see if login is happening or not.

This is possible in jmeter 11 onwards.
If you are using jmeter 9 or below, then use a user defined variable to save the session id and replace in your script across all places the hard coded session id witb this user defined variable before you run the script each time.

Hope it helps.

Thanks and Regards,
Kavya Srinivasan


Sent from Samsung Mobile



-------- Original message --------
From: Vikash kumar <vi...@tracesoftware.in>
Date: 15/03/2016 18:42 (GMT+05:30)
To: JMeter Users List <us...@jmeter.apache.org>
Subject: Recorded scripts are unable to perform login operation while playing in Jmeter.


Hi,

I've recorded some scenarios  including "Login" to my application scenario
 from Jmeter, but while playing the recorded scripts from Jmeter i am
seeing that the user hasn't logged in and is still present at the landing
page only. I have used a 'Tree Listener' and navigated to the request and
opened the "Response Data" tab,  seeing the HTML response of the request
sent and received by JMeter. I've used only one user/thread for my
execution.

Any idea why it's showing like this in the HTML response of "Response Data"
tab in the  'Tree Listener'  listener. Do i need to tweak any change or
something.

Earliest reply is deeply appreciable.

Regards,
Vikash