[Webtest] verifyLinks and clickLink
Marc Guillemot <email@example.com>
Wed, 13 Aug 2008 15:22:57 +0200
saving all visited pages of verifyLinks could be an interested feature
(with default false). Please open an issue for that.
A correct implementation of your idea with repeat could be:
<repeat xpath="//a" counterName="curLink">
Krys Malak wrote:
> i'm new to webtest and have a question regarding a test i want to implement.
> I want to visit all links on a page and store the resulting html pages.
> verifyLinks just checks if they are valid but does not store the html page.
> clickLink visits the page and stores it. So i need a mix of both features.
> I tried to work with repeat and inside that tried to clickLink via the
> xpath. But since all links have the same xpath, only the first one is
> <group description="Links">
> <repeat count="3"
> <verifyXPath description="simple match"
> <verifyLinkedContent xpath="/html/body/a/@href"/>
> <clickLink xpath="/html/body/a" />
> So i need either a hint on how to correct my code so i can iterate
> through the links on my page and not always get just the first one.
> Or some info if it would be possible to change the verifyLinks step
> somehow so it also stores the html pages.
> Hope, it's clear what I want to say, and somebody can help.