[Webtest] How to test multiple elements on the same page?

Dierk Konig Dierk.Koenig@canoo.com
Sat, 2 Mar 2002 14:35:22 +0100


Hi Jerry,

> If I have multiple links or buttons on a page that need to be followed, 
> what is the proper way to set that up in WebTest? Do I run through one 
> route, invoke the beginning again, then run through another route? Or is 
> there a more elegant way?

WebTest leaves that totally up to you and either way can be appropriate.

If you ask for the "best-practice", we normally test in two strategies:

1) Use Case driven. Customer specifies the use case as navigation steps
trough the links. We put them in webtest format, verify with the customer,
build the system and run the tests. This in fact resembles "always go
back to start" strategy that you mentioned.

Note that in your logical "navigation tree" you can (and should) avoid
duplication that shows up on "shared paths". Doc gives some hints.

2) Developer driven. Developers have an insight into problematic parts of
the system. Beside writing unit tests for these parts, they write webtests
to verify functionality end-to-end. In this case, the navigation typically
jumps right into the problematic part (via "invoke") leaving out 
"normal user" navigation steps.

If your question was more about link-checking only, you can use the
"verifylinks" step to do that automatically.

Hope that helps
cheers
Dierk