[Webtest] verifyLinks and clickLink

Krys Malak Krys Malak" <airmalak@gmx.de
Wed, 30 Jul 2008 10:04:19 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C8F22B.A29AAB20
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

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

------=_NextPart_000_0008_01C8F22B.A29AAB20
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.6000.16674" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial size=3D2>i'm =
new to webtest=20
and have a question regarding a test i want to =
implement.</FONT></SPAN></DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial size=3D2>I want =
to visit all=20
links on a page and store the resulting&nbsp;html pages. =
</FONT></SPAN><SPAN=20
class=3D609425807-30072008><FONT face=3DArial size=3D2>verifyLinks just =
checks if they=20
are valid but does not store the html page.</FONT></SPAN></DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial =
size=3D2>clickLink visits the=20
page and stores it. </FONT></SPAN><SPAN class=3D609425807-30072008><FONT =

face=3DArial size=3D2>So i need a mix of both =
features.</FONT></SPAN></DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial size=3D2>I =
tried to work with=20
repeat and inside that tried to clickLink via the xpath. But since all =
links=20
have the same xpath, only the first one is visited.</FONT></SPAN></DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&lt;group=20
description=3D"Links"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;repeat=20
count=3D"3"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xpath=3D"/=
html/body/a"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&lt;verifyXPath=20
description=3D"simple =
match"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xpath=3D"/html/body/a"<BR>&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;regex=3D"true"<BR>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&gt;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;verifyLinkedContent=20
xpath=3D"<A>/html/body/a/@href"/</A>&gt;&nbsp;<BR>&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&lt;clickLink xpath=3D"/html/body/a" =
/&gt;<BR>&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&lt;previousResponse&gt;&lt;/previousResponse&gt;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp=
;&nbsp;&lt;/repeat&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/group&gt;</FONT></SPAN><=
/DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial size=3D2>So i =
need either a=20
hint on how to correct my code so i can iterate through the links on my =
page and=20
not always get just the first one.</FONT></SPAN></DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial size=3D2>Or =
some info if it=20
would be possible to change the verifyLinks step somehow so it also =
stores the=20
html pages.</FONT></SPAN></DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial size=3D2>Hope, =
it's clear=20
what I want to say, and somebody can help.</FONT></SPAN></DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2>Cheers,</FONT></SPAN></DIV>
<DIV><SPAN class=3D609425807-30072008><FONT face=3DArial=20
size=3D2>Krys</FONT></SPAN></DIV></BODY></HTML>

------=_NextPart_000_0008_01C8F22B.A29AAB20--