You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Bloomen <ml...@yahoo.com> on 2008/10/15 15:05:29 UTC

How to test clicking on links?

Dear Friends,

I am new to JMeter.And i am just full of doubts...To start with, when
testing a web application, how to test clicking on a link...that is for
example if the link name is 'nabble' and it navigates to a particular page,
how can I instruct JMeter to click on nabble and then check if it has
navigated to the right page.

Thanks
Bloomen
-- 
View this message in context: http://www.nabble.com/How-to-test-clicking-on-links--tp19993062p19993062.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: How to test clicking on links?

Posted by Anthony Chadszinow <ac...@squiz.net>.
Hi Bloomen,

Can't help with assertions.  Haven't used them at all yet.  Can you 
instruct Jmeter to click on a button? ... no not really.  You can click 
on the button yourself; work out what gets sent to the webserver on the 
click and replicate that with samplers OR you can write some regular 
expressions to extract what the button does in a bit more of a generic 
way and replicate the request but it's not like you can make jmeter just 
click something and whatever that something triggers will get triggered 
automatically. 

Jmeter isn't a browser & won't execute any JS that might be attached to 
a button.  It assumes you know more than the fact that a button exists.  
It assumes you know what the button does or will do in every situation 
and you have to build your tests accordingly.

Chad
PS This question is on a different subject so you should have posted 
this as a new email. Also it would have been better not to direct the 
email at me. I'm just a user and definitely not a Guru. You would get 
more help by posing your question to the community.

Bloomen wrote:
> Hey Anthony,
>
> Thanks a lot...that helped and i was looking for the simple solution:)
>
> Another simple yet looking complicated to me problem....I run a search, and
> clicking on the result displayed my application navigates to a detailed
> page.In the detailed page i have many details displayed in fields.Is there a
> way to check if the fields contain the expected data...how can an assertion
> be can be used???Also is there a way to instruct JMeter to click on a
> button??Or is it like i shud be mentioning the URL it should navigate to if
> i click that button??
>
> Many thanks in advance
>
> Bloomen.
>
>
>
> Bloomen wrote:
>   
>> Dear Friends,
>>
>> I am new to JMeter.And i am just full of doubts...To start with, when
>> testing a web application, how to test clicking on a link...that is for
>> example if the link name is 'nabble' and it navigates to a particular
>> page, how can I instruct JMeter to click on nabble and then check if it
>> has navigated to the right page.
>>
>> Thanks
>> Bloomen
>>
>>     
>
>   

-- 
Anthony Chadszinow
MySource Classic Lead Developer

Squiz
92 Jarrett St Leichhardt, Sydney NSW, Australia 2040 
t:    13000 SQUIZ ( Support )
t:    8507 9900 / 1300 130 661
f:    8507 9988
w:    www.matrix.squiz.net
w:    www.squiz.net

Sydney  |  Melbourne  |  Canberra  |  Hobart  |  Wellington  |  London 

Open Source  - Own it  -  Squiz.net 

----------------------------------------------------

IMPORTANT:This email (and any attachments) is commercial-in-confidence and
or may be legally privileged and must not be forwarded, copied or shared
without express permission from Squiz. If you are not the intended
recipient, you may not legally copy, disclose or use the contents in any way
and you should 
contact squiz@squiz.net immediately and destroy this message and any
attachments. Thank you.


Re: How to test clicking on links?

Posted by Bloomen <ml...@yahoo.com>.
Hey Anthony,

Thanks a lot...that helped and i was looking for the simple solution:)

Another simple yet looking complicated to me problem....I run a search, and
clicking on the result displayed my application navigates to a detailed
page.In the detailed page i have many details displayed in fields.Is there a
way to check if the fields contain the expected data...how can an assertion
be can be used???Also is there a way to instruct JMeter to click on a
button??Or is it like i shud be mentioning the URL it should navigate to if
i click that button??

Many thanks in advance

Bloomen.



Bloomen wrote:
> 
> Dear Friends,
> 
> I am new to JMeter.And i am just full of doubts...To start with, when
> testing a web application, how to test clicking on a link...that is for
> example if the link name is 'nabble' and it navigates to a particular
> page, how can I instruct JMeter to click on nabble and then check if it
> has navigated to the right page.
> 
> Thanks
> Bloomen
> 

-- 
View this message in context: http://www.nabble.com/How-to-test-clicking-on-links--tp19993062p20029450.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: How to test clicking on links?

Posted by Anthony Chadszinow <ac...@squiz.net>.
Hi Bloomen,

Be a bit more positive and cast *some* of those doubts away :-P

When I first read your email I thought easy as but now I think I see why 
it may be a bit more complicated.

The simple answer -
Clicking a link is as simple as setting up an HTTP sampler to the URL of 
the page the link specifies but how to test success?  Jmeter in general 
assumes you know what the correct answer is when you request a URL.   
This means you should know what piece of content is on that page which 
could tell you if you have arrived at the right page.  A bread crumb in 
the content perhaps or maybe the page has a different unique line of 
content in it.  You could write a reg expression extractor to look for 
that content and [and this is where I'm a bit hazy because I haven't 
used them yet] you could setup an assertion so see if the content in 
that variable the reg. expression pulled out is equal to what you expected.

The other answer -
But you are talking about clicking on links and not going to preset URLs 
and seeing if they are up.  It's a similar answer here which is Jmeter 
expects you know what is correct on the site & for you to build your 
tests accordingly.  You could get the content of the first page and run 
a reg. exp to see and assert if the link is actually equal to what it 
should be.

The final degree of complexity -
Another thing you can do is write a reg expression to extra all links on 
page one and then loop over all and use a HTTP sampler to request what 
the link advises.  I assume it's possible to set up an assertion that if 
you get something other than a 200 OK code from the webserver you can 
setup some sort of flag.  200 OK is the tip of the iceburg however.  
There may be other codes which are valid like 301 or 302.  What I talk 
about here might sound simple but there is always the case that the 
links aren't absolute paths.  You would have to setup logic controllers 
and more expressions to detect this and if they aren't you will have to 
know the rules of relative link paths and build the full link yourself 
based on your current test page location.

Good luck!

What initially sounded like a simple question has snowballed into a tree 
of possibilities.  Maybe you should just play with Jmeter more before 
you move onto what you really need to do so you can pose your question 
in a more jmeter thinking way to avoid multiple answers.

Chad

Bloomen wrote:
> Dear Friends,
>
> I am new to JMeter.And i am just full of doubts...To start with, when
> testing a web application, how to test clicking on a link...that is for
> example if the link name is 'nabble' and it navigates to a particular page,
> how can I instruct JMeter to click on nabble and then check if it has
> navigated to the right page.
>
> Thanks
> Bloomen
>   

-- 
Anthony Chadszinow
MySource Classic Lead Developer

Squiz
92 Jarrett St Leichhardt, Sydney NSW, Australia 2040 
t:    13000 SQUIZ ( Support )
t:    8507 9900 / 1300 130 661
f:    8507 9988
e:    achadszinow@squiz.net
w:    www.matrix.squiz.net
w:    www.squiz.net

Sydney  |  Melbourne  |  Canberra  |  Hobart  |  Wellington  |  London 

Open Source  - Own it  -  Squiz.net 

----------------------------------------------------

IMPORTANT:This email (and any attachments) is commercial-in-confidence and
or may be legally privileged and must not be forwarded, copied or shared
without express permission from Squiz. If you are not the intended
recipient, you may not legally copy, disclose or use the contents in any way
and you should 
contact squiz@squiz.net immediately and destroy this message and any
attachments. Thank you.


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