[Webtest] verifyLinks and clickLink

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Wed, 13 Aug 2008 15:22:57 +0200


Hi,

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">
  <clickLink xpath="$curLink"/>
</repeat>

Cheers,
Marc.
-- 
Blog: http://mguillem.wordpress.com


Krys Malak wrote:
> Hi,
>  
> 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
> visited.
>  
>    <group description="Links">
>     <repeat count="3"
>         xpath="/html/body/a">
>     
>      <verifyXPath description="simple match"
>                xpath="/html/body/a"
>                regex="true"
>                />    
>          <verifyLinkedContent xpath="/html/body/a/@href"/> 
>       <clickLink xpath="/html/body/a" />
>       <previousResponse></previousResponse>     
>     
>     </repeat>
>    </group>
>  
>  
> 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.
>  
> Cheers,
> Krys