You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Nisha G." <ni...@gmail.com> on 2011/08/18 13:03:43 UTC

Reg: Search Functionality and Dynamic Results

Hello Friends,

I am newbie to JMeter. While working on creation of JMeter scripts I stuck
on one scenario and cannot move ahead.

Login to App-->Search with wild card *-->System display's 15 to 100 records
which are getting updated in a flash-->Select some odd number of records
from 100 rows and Do some action on selected records.

When I recorded the scenario then JMeter captured some filed values but
while re-executing the script as the contents have been changed so it fails
showing the error.

Please suggest me how to move ahead with this dynamic content. If you people
can provide me an example that would be really helpful to me.

Thanks,
*Nisha*

Re: Reg: Search Functionality and Dynamic Results

Posted by Adrian Speteanu <as...@gmail.com>.
+1 to deepak's explanation, it completely slipped my mind, its so basic that
you forget you do it.... looking in the logs shows you if you're not
providing value for an expected parameter and much more, very useful.

On Thu, Aug 18, 2011 at 7:44 PM, Deepak Shetty <sh...@gmail.com> wrote:

> The easiest way to figure out issues like these are if you have someone who
> can tell you what the problem on the server/application is (either you can
> read your application logs or you have a developer available to tell you) -
> it will tell you whether you are passing an incorrect value or you arent
> logged in or whatever.
>
> if not you have to compare each request/response pair from Jmeter(view
> results tree listener) with the browser request/response (using
> firebug/livehtppheaders etc etc).
>
> On Thu, Aug 18, 2011 at 5:09 AM, Nisha G. <ni...@gmail.com> wrote:
>
> > Hi Adrian,
> >
> > Thanks a lot for such a brief explanation and suggestions mentioned.
> >
> > I think, I should dig into the problem first step by step.
> >
> > Regards,
> > Nisha
> >
> >
> > On Thu, Aug 18, 2011 at 5:32 PM, Adrian Speteanu <asp.adieu@gmail.com
> > >wrote:
> >
> > > Sidepoint: you should also consider this a trivial bug - you're doing
> > > something a little wrong with your query then you should get 400
> response
> > > code not 500, that is when something goes wrong server side (and I
> doubt
> > > its
> > > the second, but do mention this to the developers). Read:
> > > http://www.w3.org/Protocols/HTTP/HTRESP.html for details.
> > >
> > > Back to problem:
> > > 1. Have you considered the "Cookie manager" before using the regex to
> > > extract the session?
> > > (I'm not necessarily sure that you are using it correctly and there are
> a
> > > lot of things that you can do wrong when you try to manage sessions
> > > yourself, especially when you begin with JMeter)
> > >
> > > Looking at the parameter's value, I don't recognise why its like that,
> > > seems
> > > a little weird, but if the sessions is surely ok and you send the exact
> > > string as the browser, it will work the same way (just make sure that
> the
> > > string of the value is correct).
> > >
> > > 2. If I were in your position, I'd try to reconstitute the query step
> by
> > > step, myself and not rely on the recorded sampler - to see which
> > parameter
> > > I'm using incorrectly, but this is general practice.
> > >
> > > 3. Consider changing the HTTP method and redirect type in the sampler
> and
> > > play with the combinations of them - its another common cause for the
> > > application to return an error when all other are ok (url & parameter
> > names
> > > and values).
> > >
> > >
> > >
> > > On Thu, Aug 18, 2011 at 2:26 PM, Nisha G. <ni...@gmail.com>
> wrote:
> > >
> > > > Hello Adrian,
> > > >
> > > > For session, I am using a regular expression and I have handled that
> > > point.
> > > >
> > > > While executing JMeter sends the same value of the parameter called
> as
> > > > "SelectedItems" as below when I recorded the scenario.
> > > >
> > > >
> > >
> >
> "itemname_sort%3DItem_1_PART_101%60org_itemname_sort%3DVISTEON%60id%3D58680%7Cname_sort%3D...."
> > > >
> > > > Below is the request which got recorded by JMeter with the values.
> > > >
> > > >
> > > > Then JMeter shows me up an error message like response code as :500
> and
> > > it
> > > > fails. What further investigation do I need to perform.
> > > >
> > > > Any suggestions most welcome.
> > > >
> > > > Regards,
> > > > Nisha
> > > >
> > > >
> > > > On Thu, Aug 18, 2011 at 4:43 PM, Adrian Speteanu <
> asp.adieu@gmail.com
> > > > >wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > You are getting an error message, not a incorrect list of results,
> > > > > therefore, you should look into the message of the error to see
> what
> > is
> > > > > wrong (all solutions start from knowing the problem). Do you a
> > session
> > > > > cookie so that the virtual user stays logged in the application
> after
> > > log
> > > > > in?
> > > > >
> > > > > Regards,
> > > > > Adrian S
> > > > >
> > > > > On Thu, Aug 18, 2011 at 2:03 PM, Nisha G. <ni...@gmail.com>
> > > wrote:
> > > > >
> > > > > > Hello Friends,
> > > > > >
> > > > > > I am newbie to JMeter. While working on creation of JMeter
> scripts
> > I
> > > > > stuck
> > > > > > on one scenario and cannot move ahead.
> > > > > >
> > > > > > Login to App-->Search with wild card *-->System display's 15 to
> 100
> > > > > records
> > > > > > which are getting updated in a flash-->Select some odd number of
> > > > records
> > > > > > from 100 rows and Do some action on selected records.
> > > > > >
> > > > > > When I recorded the scenario then JMeter captured some filed
> values
> > > but
> > > > > > while re-executing the script as the contents have been changed
> so
> > it
> > > > > fails
> > > > > > showing the error.
> > > > > >
> > > > > > Please suggest me how to move ahead with this dynamic content. If
> > you
> > > > > > people
> > > > > > can provide me an example that would be really helpful to me.
> > > > > >
> > > > > > Thanks,
> > > > > > *Nisha*
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Reg: Search Functionality and Dynamic Results

Posted by Deepak Shetty <sh...@gmail.com>.
The easiest way to figure out issues like these are if you have someone who
can tell you what the problem on the server/application is (either you can
read your application logs or you have a developer available to tell you) -
it will tell you whether you are passing an incorrect value or you arent
logged in or whatever.

if not you have to compare each request/response pair from Jmeter(view
results tree listener) with the browser request/response (using
firebug/livehtppheaders etc etc).

On Thu, Aug 18, 2011 at 5:09 AM, Nisha G. <ni...@gmail.com> wrote:

> Hi Adrian,
>
> Thanks a lot for such a brief explanation and suggestions mentioned.
>
> I think, I should dig into the problem first step by step.
>
> Regards,
> Nisha
>
>
> On Thu, Aug 18, 2011 at 5:32 PM, Adrian Speteanu <asp.adieu@gmail.com
> >wrote:
>
> > Sidepoint: you should also consider this a trivial bug - you're doing
> > something a little wrong with your query then you should get 400 response
> > code not 500, that is when something goes wrong server side (and I doubt
> > its
> > the second, but do mention this to the developers). Read:
> > http://www.w3.org/Protocols/HTTP/HTRESP.html for details.
> >
> > Back to problem:
> > 1. Have you considered the "Cookie manager" before using the regex to
> > extract the session?
> > (I'm not necessarily sure that you are using it correctly and there are a
> > lot of things that you can do wrong when you try to manage sessions
> > yourself, especially when you begin with JMeter)
> >
> > Looking at the parameter's value, I don't recognise why its like that,
> > seems
> > a little weird, but if the sessions is surely ok and you send the exact
> > string as the browser, it will work the same way (just make sure that the
> > string of the value is correct).
> >
> > 2. If I were in your position, I'd try to reconstitute the query step by
> > step, myself and not rely on the recorded sampler - to see which
> parameter
> > I'm using incorrectly, but this is general practice.
> >
> > 3. Consider changing the HTTP method and redirect type in the sampler and
> > play with the combinations of them - its another common cause for the
> > application to return an error when all other are ok (url & parameter
> names
> > and values).
> >
> >
> >
> > On Thu, Aug 18, 2011 at 2:26 PM, Nisha G. <ni...@gmail.com> wrote:
> >
> > > Hello Adrian,
> > >
> > > For session, I am using a regular expression and I have handled that
> > point.
> > >
> > > While executing JMeter sends the same value of the parameter called as
> > > "SelectedItems" as below when I recorded the scenario.
> > >
> > >
> >
> "itemname_sort%3DItem_1_PART_101%60org_itemname_sort%3DVISTEON%60id%3D58680%7Cname_sort%3D...."
> > >
> > > Below is the request which got recorded by JMeter with the values.
> > >
> > >
> > > Then JMeter shows me up an error message like response code as :500 and
> > it
> > > fails. What further investigation do I need to perform.
> > >
> > > Any suggestions most welcome.
> > >
> > > Regards,
> > > Nisha
> > >
> > >
> > > On Thu, Aug 18, 2011 at 4:43 PM, Adrian Speteanu <asp.adieu@gmail.com
> > > >wrote:
> > >
> > > > Hi,
> > > >
> > > > You are getting an error message, not a incorrect list of results,
> > > > therefore, you should look into the message of the error to see what
> is
> > > > wrong (all solutions start from knowing the problem). Do you a
> session
> > > > cookie so that the virtual user stays logged in the application after
> > log
> > > > in?
> > > >
> > > > Regards,
> > > > Adrian S
> > > >
> > > > On Thu, Aug 18, 2011 at 2:03 PM, Nisha G. <ni...@gmail.com>
> > wrote:
> > > >
> > > > > Hello Friends,
> > > > >
> > > > > I am newbie to JMeter. While working on creation of JMeter scripts
> I
> > > > stuck
> > > > > on one scenario and cannot move ahead.
> > > > >
> > > > > Login to App-->Search with wild card *-->System display's 15 to 100
> > > > records
> > > > > which are getting updated in a flash-->Select some odd number of
> > > records
> > > > > from 100 rows and Do some action on selected records.
> > > > >
> > > > > When I recorded the scenario then JMeter captured some filed values
> > but
> > > > > while re-executing the script as the contents have been changed so
> it
> > > > fails
> > > > > showing the error.
> > > > >
> > > > > Please suggest me how to move ahead with this dynamic content. If
> you
> > > > > people
> > > > > can provide me an example that would be really helpful to me.
> > > > >
> > > > > Thanks,
> > > > > *Nisha*
> > > > >
> > > >
> > >
> >
>

Re: Reg: Search Functionality and Dynamic Results

Posted by Bruce Ide <fl...@gmail.com>.
There are a couple of problems you're likely to run into with the recording
sampler and dynamic content. The first is that the JsessionID is recorded
along with everything else, then when you log out the session ID changes and
it doesn't in your test. That can be resolved, as was mentioned, with a
cookie manager. You do have to look through your test, then, and remove any
references to JsessionID wherever samplers might be sending it in as a
parameter, since the cookie manager is now handling it.

The second thing is actual content on the page could change. In your case it
sounds like the records that you're working with are. Since your webapp is
displaying records and you're selecting some, you should be able to look at
the response from the query where you get the records and find the records
in the HTML. You could then use a xpath or regex postprocessor to extract
these record lines into variables. You can then use those variables in your
request that submits them instead of hard coded values.

I usually use the recording controller to get a basic framework for my test
and then start going in and removing requests and parameterizing values in
the requests until the test does what I want. I mostly use jmeter for
functional testing of web based applications. I've found that running the
test fairly often as you develop it is very helpful to the process of
getting it to where you want it. Once you start playing with variables it
helps to have a view results tree listener (That you can disable when not
debugging the test) and one or more debug samplers at various points in the
test. That makes it very easy to see what the test is doing, and what
variables are being created at various points in the test.

-- 
Bruce Ide
FlyingRhenquest@gmail.com

Re: Reg: Search Functionality and Dynamic Results

Posted by "Nisha G." <ni...@gmail.com>.
Hi Adrian,

Thanks a lot for such a brief explanation and suggestions mentioned.

I think, I should dig into the problem first step by step.

Regards,
Nisha


On Thu, Aug 18, 2011 at 5:32 PM, Adrian Speteanu <as...@gmail.com>wrote:

> Sidepoint: you should also consider this a trivial bug - you're doing
> something a little wrong with your query then you should get 400 response
> code not 500, that is when something goes wrong server side (and I doubt
> its
> the second, but do mention this to the developers). Read:
> http://www.w3.org/Protocols/HTTP/HTRESP.html for details.
>
> Back to problem:
> 1. Have you considered the "Cookie manager" before using the regex to
> extract the session?
> (I'm not necessarily sure that you are using it correctly and there are a
> lot of things that you can do wrong when you try to manage sessions
> yourself, especially when you begin with JMeter)
>
> Looking at the parameter's value, I don't recognise why its like that,
> seems
> a little weird, but if the sessions is surely ok and you send the exact
> string as the browser, it will work the same way (just make sure that the
> string of the value is correct).
>
> 2. If I were in your position, I'd try to reconstitute the query step by
> step, myself and not rely on the recorded sampler - to see which parameter
> I'm using incorrectly, but this is general practice.
>
> 3. Consider changing the HTTP method and redirect type in the sampler and
> play with the combinations of them - its another common cause for the
> application to return an error when all other are ok (url & parameter names
> and values).
>
>
>
> On Thu, Aug 18, 2011 at 2:26 PM, Nisha G. <ni...@gmail.com> wrote:
>
> > Hello Adrian,
> >
> > For session, I am using a regular expression and I have handled that
> point.
> >
> > While executing JMeter sends the same value of the parameter called as
> > "SelectedItems" as below when I recorded the scenario.
> >
> >
> "itemname_sort%3DItem_1_PART_101%60org_itemname_sort%3DVISTEON%60id%3D58680%7Cname_sort%3D...."
> >
> > Below is the request which got recorded by JMeter with the values.
> >
> >
> > Then JMeter shows me up an error message like response code as :500 and
> it
> > fails. What further investigation do I need to perform.
> >
> > Any suggestions most welcome.
> >
> > Regards,
> > Nisha
> >
> >
> > On Thu, Aug 18, 2011 at 4:43 PM, Adrian Speteanu <asp.adieu@gmail.com
> > >wrote:
> >
> > > Hi,
> > >
> > > You are getting an error message, not a incorrect list of results,
> > > therefore, you should look into the message of the error to see what is
> > > wrong (all solutions start from knowing the problem). Do you a session
> > > cookie so that the virtual user stays logged in the application after
> log
> > > in?
> > >
> > > Regards,
> > > Adrian S
> > >
> > > On Thu, Aug 18, 2011 at 2:03 PM, Nisha G. <ni...@gmail.com>
> wrote:
> > >
> > > > Hello Friends,
> > > >
> > > > I am newbie to JMeter. While working on creation of JMeter scripts I
> > > stuck
> > > > on one scenario and cannot move ahead.
> > > >
> > > > Login to App-->Search with wild card *-->System display's 15 to 100
> > > records
> > > > which are getting updated in a flash-->Select some odd number of
> > records
> > > > from 100 rows and Do some action on selected records.
> > > >
> > > > When I recorded the scenario then JMeter captured some filed values
> but
> > > > while re-executing the script as the contents have been changed so it
> > > fails
> > > > showing the error.
> > > >
> > > > Please suggest me how to move ahead with this dynamic content. If you
> > > > people
> > > > can provide me an example that would be really helpful to me.
> > > >
> > > > Thanks,
> > > > *Nisha*
> > > >
> > >
> >
>

Re: Reg: Search Functionality and Dynamic Results

Posted by Adrian Speteanu <as...@gmail.com>.
Sidepoint: you should also consider this a trivial bug - you're doing
something a little wrong with your query then you should get 400 response
code not 500, that is when something goes wrong server side (and I doubt its
the second, but do mention this to the developers). Read:
http://www.w3.org/Protocols/HTTP/HTRESP.html for details.

Back to problem:
1. Have you considered the "Cookie manager" before using the regex to
extract the session?
(I'm not necessarily sure that you are using it correctly and there are a
lot of things that you can do wrong when you try to manage sessions
yourself, especially when you begin with JMeter)

Looking at the parameter's value, I don't recognise why its like that, seems
a little weird, but if the sessions is surely ok and you send the exact
string as the browser, it will work the same way (just make sure that the
string of the value is correct).

2. If I were in your position, I'd try to reconstitute the query step by
step, myself and not rely on the recorded sampler - to see which parameter
I'm using incorrectly, but this is general practice.

3. Consider changing the HTTP method and redirect type in the sampler and
play with the combinations of them - its another common cause for the
application to return an error when all other are ok (url & parameter names
and values).



On Thu, Aug 18, 2011 at 2:26 PM, Nisha G. <ni...@gmail.com> wrote:

> Hello Adrian,
>
> For session, I am using a regular expression and I have handled that point.
>
> While executing JMeter sends the same value of the parameter called as
> "SelectedItems" as below when I recorded the scenario.
>
> "itemname_sort%3DItem_1_PART_101%60org_itemname_sort%3DVISTEON%60id%3D58680%7Cname_sort%3D...."
>
> Below is the request which got recorded by JMeter with the values.
>
>
> Then JMeter shows me up an error message like response code as :500 and it
> fails. What further investigation do I need to perform.
>
> Any suggestions most welcome.
>
> Regards,
> Nisha
>
>
> On Thu, Aug 18, 2011 at 4:43 PM, Adrian Speteanu <asp.adieu@gmail.com
> >wrote:
>
> > Hi,
> >
> > You are getting an error message, not a incorrect list of results,
> > therefore, you should look into the message of the error to see what is
> > wrong (all solutions start from knowing the problem). Do you a session
> > cookie so that the virtual user stays logged in the application after log
> > in?
> >
> > Regards,
> > Adrian S
> >
> > On Thu, Aug 18, 2011 at 2:03 PM, Nisha G. <ni...@gmail.com> wrote:
> >
> > > Hello Friends,
> > >
> > > I am newbie to JMeter. While working on creation of JMeter scripts I
> > stuck
> > > on one scenario and cannot move ahead.
> > >
> > > Login to App-->Search with wild card *-->System display's 15 to 100
> > records
> > > which are getting updated in a flash-->Select some odd number of
> records
> > > from 100 rows and Do some action on selected records.
> > >
> > > When I recorded the scenario then JMeter captured some filed values but
> > > while re-executing the script as the contents have been changed so it
> > fails
> > > showing the error.
> > >
> > > Please suggest me how to move ahead with this dynamic content. If you
> > > people
> > > can provide me an example that would be really helpful to me.
> > >
> > > Thanks,
> > > *Nisha*
> > >
> >
>

Re: Reg: Search Functionality and Dynamic Results

Posted by "Nisha G." <ni...@gmail.com>.
Hello Adrian,

For session, I am using a regular expression and I have handled that point.

While executing JMeter sends the same value of the parameter called as
"SelectedItems" as below when I recorded the scenario.
"itemname_sort%3DItem_1_PART_101%60org_itemname_sort%3DVISTEON%60id%3D58680%7Cname_sort%3D...."

Below is the request which got recorded by JMeter with the values.


Then JMeter shows me up an error message like response code as :500 and it
fails. What further investigation do I need to perform.

Any suggestions most welcome.

Regards,
Nisha


On Thu, Aug 18, 2011 at 4:43 PM, Adrian Speteanu <as...@gmail.com>wrote:

> Hi,
>
> You are getting an error message, not a incorrect list of results,
> therefore, you should look into the message of the error to see what is
> wrong (all solutions start from knowing the problem). Do you a session
> cookie so that the virtual user stays logged in the application after log
> in?
>
> Regards,
> Adrian S
>
> On Thu, Aug 18, 2011 at 2:03 PM, Nisha G. <ni...@gmail.com> wrote:
>
> > Hello Friends,
> >
> > I am newbie to JMeter. While working on creation of JMeter scripts I
> stuck
> > on one scenario and cannot move ahead.
> >
> > Login to App-->Search with wild card *-->System display's 15 to 100
> records
> > which are getting updated in a flash-->Select some odd number of records
> > from 100 rows and Do some action on selected records.
> >
> > When I recorded the scenario then JMeter captured some filed values but
> > while re-executing the script as the contents have been changed so it
> fails
> > showing the error.
> >
> > Please suggest me how to move ahead with this dynamic content. If you
> > people
> > can provide me an example that would be really helpful to me.
> >
> > Thanks,
> > *Nisha*
> >
>

Re: Reg: Search Functionality and Dynamic Results

Posted by Adrian Speteanu <as...@gmail.com>.
Hi,

You are getting an error message, not a incorrect list of results,
therefore, you should look into the message of the error to see what is
wrong (all solutions start from knowing the problem). Do you a session
cookie so that the virtual user stays logged in the application after log
in?

Regards,
Adrian S

On Thu, Aug 18, 2011 at 2:03 PM, Nisha G. <ni...@gmail.com> wrote:

> Hello Friends,
>
> I am newbie to JMeter. While working on creation of JMeter scripts I stuck
> on one scenario and cannot move ahead.
>
> Login to App-->Search with wild card *-->System display's 15 to 100 records
> which are getting updated in a flash-->Select some odd number of records
> from 100 rows and Do some action on selected records.
>
> When I recorded the scenario then JMeter captured some filed values but
> while re-executing the script as the contents have been changed so it fails
> showing the error.
>
> Please suggest me how to move ahead with this dynamic content. If you
> people
> can provide me an example that would be really helpful to me.
>
> Thanks,
> *Nisha*
>