You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by phanikishan <ph...@gmail.com> on 2009/07/07 13:25:27 UTC

Modifying data while filling forms and basic Jmeter help

Hey guys,
I'm a new user to Jmeter and have a few doubts. I am testing my
web-application for performance. It involves logging in, making a database
query, modifying a certain parameter, saving it and then logging out.
I want to modify the parameter dynamically (rand() etc.) 
Please suggest how exactly to go about it?
Till now I have:
Used the recording feature and recorded the steps involved.
Tried running the test for a single user by simply modifying by hardcoding a
different value to the parameter (which didnt work). I have also had a
sampler error as my browser tried requesting a css sheet.
I also am not able to figure out if the test plan has been executed the way
I think it to be.
Please help me or point me to the right forums/threads.
Thank you

Phani Kishan
-- 
View this message in context: http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24371548.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Modifying data while filling forms and basic Jmeter help

Posted by Deepak Shetty <sh...@gmail.com>.
Look at CSV Data Set Config
regards
deepak

On Mon, Jul 20, 2009 at 3:53 AM, phanikishan <ph...@gmail.com> wrote:

>
>
>
> Deepak Shetty wrote:
> >
> > Hi
> > Create a Regex Extraction Post Processor , give it a name like
> > inputTimeStamp
> > In regex expression type something like
> > name=['"]token['"]\s*?value=['"]([^'"]*) -->test with some online regex
> > tester. (this one is case sensitive and order of name and value matters)
> > In template type $1$ --> extract the match within the first parantheses
> > and in match no enter 1  --> first match
> >
> > rest should work. if it doesnt check whether the value was extracted
> > correctly and whether its being sent in the right parameter
> > regards
> > deepak
> >
> >
> >
>
> Hey,
> Thanks a lot deepak! After a few modifications I have been able to make it
> work!
> Thank you very much. Btw could you tell me if we can use files to take in
> random inputs, to send along with the http requests? (For eg. I want to
> create new users from info in a file)
> Thank you again!
>
> Phani Kishan
>
> --
> View this message in context:
> http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24567625.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Modifying data while filling forms and basic Jmeter help

Posted by phanikishan <ph...@gmail.com>.


Deepak Shetty wrote:
> 
> Hi
> Create a Regex Extraction Post Processor , give it a name like
> inputTimeStamp
> In regex expression type something like
> name=['"]token['"]\s*?value=['"]([^'"]*) -->test with some online regex
> tester. (this one is case sensitive and order of name and value matters)
> In template type $1$ --> extract the match within the first parantheses
> and in match no enter 1  --> first match
> 
> rest should work. if it doesnt check whether the value was extracted
> correctly and whether its being sent in the right parameter
> regards
> deepak
> 
> 
> 

Hey,
Thanks a lot deepak! After a few modifications I have been able to make it
work!
Thank you very much. Btw could you tell me if we can use files to take in
random inputs, to send along with the http requests? (For eg. I want to
create new users from info in a file)
Thank you again!

Phani Kishan

-- 
View this message in context: http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24567625.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Modifying data while filling forms and basic Jmeter help

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
Create a Regex Extraction Post Processor , give it a name like
inputTimeStamp
In regex expression type something like
name=['"]token['"]\s*?value=['"]([^'"]*) -->test with some online regex
tester. (this one is case sensitive and order of name and value matters)
In template type $1$ --> extract the match within the first parantheses
and in match no enter 1  --> first match

rest should work. if it doesnt check whether the value was extracted
correctly and whether its being sent in the right parameter
regards
deepak

On Thu, Jul 16, 2009 at 11:07 PM, phanikishan <ph...@gmail.com> wrote:

>
>
>
> Deepak Shetty wrote:
> >
> > You have to use one of the Post Processors (e.g. Regex) to extract this
> > token from the Servers response into a variable and post the data back to
> > the server whenever its needed
> > regards
> > deepak
> >
>
> Hey Deepak,
> Thanks for the help, but the help feature in Jmeter is not as helpful as
> you
> are! :)
> Please tell me how to use the regular expression extractor.
> The following is the info I wish to extract (highlighted in bold) - <input
> type = hidden name="token" value="2009-07-17 01:51:22.0">.
> What I plan to do is send a http request, use the post-processor regular
> expression extractor to get the value of the token, store it in a variable,
> send another http request but with this time value would be the one stored
> in the variable. Will it work?
> Thanks a lot,
>
> Phani Kishan
>
> --
> View this message in context:
> http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24529077.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Modifying data while filling forms and basic Jmeter help

Posted by phanikishan <ph...@gmail.com>.


Deepak Shetty wrote:
> 
> You have to use one of the Post Processors (e.g. Regex) to extract this
> token from the Servers response into a variable and post the data back to
> the server whenever its needed
> regards
> deepak
> 

Hey Deepak,
Thanks for the help, but the help feature in Jmeter is not as helpful as you
are! :)
Please tell me how to use the regular expression extractor.
The following is the info I wish to extract (highlighted in bold) - <input
type = hidden name="token" value="2009-07-17 01:51:22.0">.
What I plan to do is send a http request, use the post-processor regular
expression extractor to get the value of the token, store it in a variable,
send another http request but with this time value would be the one stored
in the variable. Will it work?
Thanks a lot,

Phani Kishan

-- 
View this message in context: http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24529077.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Modifying data while filling forms and basic Jmeter help

Posted by Deepak Shetty <sh...@gmail.com>.
You have to use one of the Post Processors (e.g. Regex) to extract this
token from the Servers response into a variable and post the data back to
the server whenever its needed
regards
deepak

On Wed, Jul 15, 2009 at 2:33 AM, phanikishan <ph...@gmail.com> wrote:

>
>
>
> Deepak Shetty wrote:
> >
> > Hi
> >>Hey the url doesnt really exist indeed, but why is it appearing in the
> > recorded commands?
> > Because the HTML page contains a reference to your css file in the form
> of
> > <link>, the browser will make a request to this CSS file and it will get
> > recorded (the browser however ignores this error)
> >>(I said stop test on sampler error and it didnt- so I guess this means no
> > errors)
> > Not necessarily. This means there are no HTTP errors (like a 500 error)
> > that
> > JMeter can detect. You must have good assertions in your test if you want
> > to
> > be able to make this statement
> >>But the main problem lies in the fact
> >>that when I go to http request which contains my login details and change
> >>them to a wrong id, the test still runs without any error.
> > If your application returns an error message (e.g. Invalid
> > username/password) with a 200 status code, JMeter wont know this an
> error.
> > You must assert the content of the returned HTML page (either it must
> > contain a success message, or it must not contain the error message or it
> > must contain a particular text only found on success) - depends on your
> > app
> > Use View results tree to view the response you obtain(render it as HTML
> > and
> > see what you are getting).
> >
> >
>
> Hey, I believe I found the source of my problem. Apparently the session Id
> generated by my server and that of Jmeter are not matching because of which
> my server is not accepting a change to the database.
> The server generates tokens and database is updated if the tokens match. Is
> there anyway I can go around this problem?
> Thanks a lot.
>
> Phani Kishan
> --
> View this message in context:
> http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24494666.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Modifying data while filling forms and basic Jmeter help

Posted by phanikishan <ph...@gmail.com>.


Deepak Shetty wrote:
> 
> Hi
>>Hey the url doesnt really exist indeed, but why is it appearing in the
> recorded commands?
> Because the HTML page contains a reference to your css file in the form of
> <link>, the browser will make a request to this CSS file and it will get
> recorded (the browser however ignores this error)
>>(I said stop test on sampler error and it didnt- so I guess this means no
> errors)
> Not necessarily. This means there are no HTTP errors (like a 500 error)
> that
> JMeter can detect. You must have good assertions in your test if you want
> to
> be able to make this statement
>>But the main problem lies in the fact
>>that when I go to http request which contains my login details and change
>>them to a wrong id, the test still runs without any error.
> If your application returns an error message (e.g. Invalid
> username/password) with a 200 status code, JMeter wont know this an error.
> You must assert the content of the returned HTML page (either it must
> contain a success message, or it must not contain the error message or it
> must contain a particular text only found on success) - depends on your
> app
> Use View results tree to view the response you obtain(render it as HTML
> and
> see what you are getting).
> 
> 

Hey, I believe I found the source of my problem. Apparently the session Id
generated by my server and that of Jmeter are not matching because of which
my server is not accepting a change to the database. 
The server generates tokens and database is updated if the tokens match. Is
there anyway I can go around this problem?
Thanks a lot.

Phani Kishan
-- 
View this message in context: http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24494666.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Modifying data while filling forms and basic Jmeter help

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
>Hey the url doesnt really exist indeed, but why is it appearing in the
recorded commands?
Because the HTML page contains a reference to your css file in the form of
<link>, the browser will make a request to this CSS file and it will get
recorded (the browser however ignores this error)
>(I said stop test on sampler error and it didnt- so I guess this means no
errors)
Not necessarily. This means there are no HTTP errors (like a 500 error) that
JMeter can detect. You must have good assertions in your test if you want to
be able to make this statement
>But the main problem lies in the fact
>that when I go to http request which contains my login details and change
>them to a wrong id, the test still runs without any error.
If your application returns an error message (e.g. Invalid
username/password) with a 200 status code, JMeter wont know this an error.
You must assert the content of the returned HTML page (either it must
contain a success message, or it must not contain the error message or it
must contain a particular text only found on success) - depends on your app
Use View results tree to view the response you obtain(render it as HTML and
see what you are getting).


On Mon, Jul 13, 2009 at 2:23 AM, phanikishan <ph...@gmail.com> wrote:

>
>
>
> Deepak Shetty wrote:
> >
> > a 404 means file not found. Observe the Requested URL and check whether
> > the
> > URL is right and the file really doesnt exist or if the URL is wrong.
> > Directly typing this URL in the browser should give you the same error.
> > Most browser incompatibilities are due to js/css which JMeter doesnt care
> > about.
> >
> Hey the url doesnt really exist indeed, but why is it appearing in the
> recorded commands? (if it doesnt exist, I never even go to the page
> right?).
> Also I'm running it on ie 6 and my web-application/page has loads of java
> scripts. So while recording what should I include the .*\.js and .*\.css
> patterns? (right now I include .* and dont exclude any).
> I have removed the css file from the http requests and run the test plan
> and
> it ran without any "errors" (I said stop test on sampler error and it didnt
> - so I guess this means no errors) . But the main problem lies in the fact
> that when I go to http request which contains my login details and change
> them to a wrong id, the test still runs without any error. I think this is
> the reason why i'm not able to change data while running a test.
> (What I tried doing was - recorded a test case which involves modifying a
> database parameter. Once recorded I tried using the Random() method to
> modify this parameter but it remains the same.)
> Can you help me as to what to do?
>
> Phani Kishan
>
> --
> View this message in context:
> http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24458475.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Modifying data while filling forms and basic Jmeter help

Posted by phanikishan <ph...@gmail.com>.


Deepak Shetty wrote:
> 
> a 404 means file not found. Observe the Requested URL and check whether
> the
> URL is right and the file really doesnt exist or if the URL is wrong.
> Directly typing this URL in the browser should give you the same error.
> Most browser incompatibilities are due to js/css which JMeter doesnt care
> about.
> 
Hey the url doesnt really exist indeed, but why is it appearing in the
recorded commands? (if it doesnt exist, I never even go to the page right?).
Also I'm running it on ie 6 and my web-application/page has loads of java
scripts. So while recording what should I include the .*\.js and .*\.css
patterns? (right now I include .* and dont exclude any). 
I have removed the css file from the http requests and run the test plan and
it ran without any "errors" (I said stop test on sampler error and it didnt
- so I guess this means no errors) . But the main problem lies in the fact
that when I go to http request which contains my login details and change
them to a wrong id, the test still runs without any error. I think this is
the reason why i'm not able to change data while running a test.
(What I tried doing was - recorded a test case which involves modifying a
database parameter. Once recorded I tried using the Random() method to
modify this parameter but it remains the same.)
Can you help me as to what to do?

Phani Kishan

-- 
View this message in context: http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24458475.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Modifying data while filling forms and basic Jmeter help

Posted by Deepak Shetty <sh...@gmail.com>.
a 404 means file not found. Observe the Requested URL and check whether the
URL is right and the file really doesnt exist or if the URL is wrong.
Directly typing this URL in the browser should give you the same error.
Most browser incompatibilities are due to js/css which JMeter doesnt care
about.



On Wed, Jul 8, 2009 at 11:55 PM, phanikishan <ph...@gmail.com> wrote:

>
>
>
> > Attach a View Results Tree listener and observe the requests you are
> > making
> > and the responses you are getting and see where the problem lies . Ensure
> > that all your tests have assertions so you can figure out the first place
> > of
> > failure easily.
> >
> > also take a look at what the error actually is
> > e.g. if your CSS file gace you a 404 error its likely that this is a
> > problem
> > with your site(the browser would ignore this error) if you have recorded
> > the
> > test, if it gave a 401 it might mean that your login probably didnt work.
> >
> >
> Hey, I did get a 404 - Not found error. So what exactly might be the
> problem
> with the site? I will try add the results of the view results listener
> soon.
> My site doesnt exactly conform to standards i.e some settings dont even
> work
> in  firefox and stuff. Does this have something to do with it too?
> I will try what you suggested and get back anyways. Thank you!
> Phani Kishan
> --
> View this message in context:
> http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24405097.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Modifying data while filling forms and basic Jmeter help

Posted by phanikishan <ph...@gmail.com>.


> Attach a View Results Tree listener and observe the requests you are
> making
> and the responses you are getting and see where the problem lies . Ensure
> that all your tests have assertions so you can figure out the first place
> of
> failure easily.
> 
> also take a look at what the error actually is
> e.g. if your CSS file gace you a 404 error its likely that this is a
> problem
> with your site(the browser would ignore this error) if you have recorded
> the
> test, if it gave a 401 it might mean that your login probably didnt work.
> 
> 
Hey, I did get a 404 - Not found error. So what exactly might be the problem
with the site? I will try add the results of the view results listener soon.
My site doesnt exactly conform to standards i.e some settings dont even work
in  firefox and stuff. Does this have something to do with it too?
I will try what you suggested and get back anyways. Thank you!
Phani Kishan
-- 
View this message in context: http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24405097.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Modifying data while filling forms and basic Jmeter help

Posted by Deepak Shetty <sh...@gmail.com>.
Its very difficult to diagnose your problem when the only information you
provide is that it didnt work and you got an error

Attach a View Results Tree listener and observe the requests you are making
and the responses you are getting and see where the problem lies . Ensure
that all your tests have assertions so you can figure out the first place of
failure easily.

also take a look at what the error actually is
e.g. if your CSS file gace you a 404 error its likely that this is a problem
with your site(the browser would ignore this error) if you have recorded the
test, if it gave a 401 it might mean that your login probably didnt work.

You can also compare what your test does with what the browser does (using
any browser sniffing tool like HTTPWatch or LiveHTTPHeaders)

See
http://jakarta.apache.org/jmeter/usermanual/functions.html#__Random
for the random function


On Tue, Jul 7, 2009 at 4:25 AM, phanikishan <ph...@gmail.com> wrote:

>
> Hey guys,
> I'm a new user to Jmeter and have a few doubts. I am testing my
> web-application for performance. It involves logging in, making a database
> query, modifying a certain parameter, saving it and then logging out.
> I want to modify the parameter dynamically (rand() etc.)
> Please suggest how exactly to go about it?
> Till now I have:
> Used the recording feature and recorded the steps involved.
> Tried running the test for a single user by simply modifying by hardcoding
> a
> different value to the parameter (which didnt work). I have also had a
> sampler error as my browser tried requesting a css sheet.
> I also am not able to figure out if the test plan has been executed the way
> I think it to be.
> Please help me or point me to the right forums/threads.
> Thank you
>
> Phani Kishan
> --
> View this message in context:
> http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24371548.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Modifying data while filling forms and basic Jmeter help

Posted by Jose Pablo Sarco <jo...@gmail.com>.
Try adding Regular Expression Extractor for correlated data:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Regular_Expression_Extractor

Also, tou can follow the example in:

http://jakarta.apache.org/jmeter/usermanual/build-test-plan.html

I hope it helps.

Jose Pablo Sarco

On Tue, Jul 7, 2009 at 12:25 PM, phanikishan <ph...@gmail.com> wrote:

>
> Hey guys,
> I'm a new user to Jmeter and have a few doubts. I am testing my
> web-application for performance. It involves logging in, making a database
> query, modifying a certain parameter, saving it and then logging out.
> I want to modify the parameter dynamically (rand() etc.)
> Please suggest how exactly to go about it?
> Till now I have:
> Used the recording feature and recorded the steps involved.
> Tried running the test for a single user by simply modifying by hardcoding
> a
> different value to the parameter (which didnt work). I have also had a
> sampler error as my browser tried requesting a css sheet.
> I also am not able to figure out if the test plan has been executed the way
> I think it to be.
> Please help me or point me to the right forums/threads.
> Thank you
>
> Phani Kishan
> --
> View this message in context:
> http://www.nabble.com/Modifying-data-while-filling-forms-and-basic-Jmeter-help-tp24371548p24371548.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>