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: [EMAIL PROTECTED]
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 [EMAIL PROTECTED] immediately and destroy this message and any
attachments. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]