[Webtest] Re: problems with verifyxpath

Massimiliano Mauri webtest@lists.canoo.com
Thu, 29 Apr 2004 09:24:55 +0200


>Max,
>
>I can't get your attachments because they are encoded in ASCII in the
>digest, and my e-mail client doesn't recognize it.  Can you just put text
>in your reply?  Best (and this is just good debugging practice), make a web
>page and test script that are as small as possible while still exhibiting
>the problem.  (You might find the problem this way, too.)  Then copy the
>text of these small files into your reply.
>  
>
sorry

the html compiled page is the following :

<html>
<head><title>Prototipe</title>
<meta http-equiv="Expires" CONTENT="-1">
<meta http-equiv="Cache-Control" CONTENT="private">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="private">
<meta http-equiv="Pragma" CONTENT="no-cache">
<base href="http://bicocca/custom/index.jsp">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../css/default.css" rel="stylesheet" type="text/css">
</head>
<body>
       <table width="100%"  border="0" cellspacing="2" cellpadding="0">
          <tr align="right" bgcolor="#66FF00">
            <td colspan="2" valign="top"><div align="center"><strong>CM
Versione:
            0.3 - 22/04/2004 - </strong><a href="_versionHistory.jsp"
target="_blank">version History </a></div></td>
          </tr>
          <tr align="right">
            <td colspan="2" valign="top">Benvenuto, Gino Redattore
[Redattore ] - <a href="doLogout.jsp">Logout</a> </td>
          </tr>
          <tr>
            <td valign="top">
              <form name="form6" method="post"  action="switch2Lettura.jsp">
                <input type="submit" name="Submit" value="Visualizza
sito publicato">
                <input type="hidden" name="itemid" value='176797252'/>
              </form></td>
            <td></td>
          </tr>
          <tr>
            <td width="30%" valign="top">
<TABLE cellspacing="0" cellpadding="0">
  <TR>
    <TD valign="top" align="left" nowrap="yes">
      <img src="res/blank.gif" height="1" width="0"/>
      <img src="/res/tree/folderOpen.gif"/>
    </TD>
    <TD valign="bottom">
      <a target="_top" name="1" href="/go/Root">Root</a>
    </TD>
  </TR>
</TABLE>
<TABLE cellspacing="0" cellpadding="0">
  <TR>
    <TD valign="top" align="left" nowrap="yes">
      <img src="res/blank.gif" height="1" width="10"/>
      <img src="/res/tree/leaf.gif"/>
    </TD>
    <TD valign="bottom">
      <a target="_top" name="166809397" href="/go/Root/Simone">Simone</a>
    </TD>
  </TR>
</TABLE>
<TABLE cellspacing="0" cellpadding="0">
  <TR>
    <TD valign="top" align="left" nowrap="yes">
      <img src="res/blank.gif" height="1" width="10"/>
      <img src="/res/tree/folderOpen.gif"/>
    </TD>
    <TD valign="bottom">
      <a target="_top" name="195688698" href="/go/Root/watt">watt</a>
    </TD>
  </TR>
</TABLE>
<TABLE cellspacing="0" cellpadding="0">
  <TR>
    <TD valign="top" align="left" nowrap="yes">
      <img src="res/blank.gif" height="1" width="20"/>
      <img src="/res/tree/leaf.gif"/>
      <img src="/res/tree/modifica.gif"/>
    </TD>
    <TD valign="bottom">
      <a target="_top" name="23094663" href="/go/Root/watt/terzo">terzo</a>
    </TD>
  </TR>
</TABLE>
<TABLE cellspacing="0" cellpadding="0">
  <TR>
    <TD valign="top" align="left" nowrap="yes">
      <img src="res/blank.gif" height="1" width="20"/>
      <img src="/res/tree/leaf.gif"/>
    </TD>
    <TD valign="bottom">
      <a target="_top" name="190428207" href="/go/Root/watt/perno">perno</a>
    </TD>
  </TR>
</TABLE>
<TABLE cellspacing="0" cellpadding="0">
  <TR>
    <TD valign="top" align="left" nowrap="yes">
      <img src="res/blank.gif" height="1" width="20"/>
      <img src="/res/tree/folderOpen.gif"/>
      <img src="/res/tree/modifica.gif"/>
    </TD>
    <TD valign="bottom">
      <a target="_top" name="176797252" href="/go/Root/watt/WATtspostami">
        <b>WATtspostami</b>
      </a>
    </TD>
  </TR>
</TABLE>
<TABLE cellspacing="0" cellpadding="0">
  <TR>
    <TD valign="top" align="left" nowrap="yes">
      <img src="res/blank.gif" height="1" width="10"/>
      <img src="/res/tree/leaf.gif"/>
      <img src="/res/tree/modifica.gif"/>
    </TD>
    <TD valign="bottom">
      <a target="_top" name="148639735" href="/go/Root/paolo">paolo</a>
    </TD>
  </TR>
</TABLE>
<TABLE cellspacing="0" cellpadding="0">
  <TR>
    <TD valign="top" align="left" nowrap="yes">
      <img src="res/blank.gif" height="1" width="10"/>
      <img src="/res/tree/leaf.gif"/>
    </TD>
    <TD valign="bottom">
      <a target="_top" name="250281805"
href="/go/Root/WATtSspostami">WATtSspostami</a>
    </TD>
  </TR>
</TABLE>
            </td>
            <td align="left">
            <table width="80%"  border="1" cellspacing="2" cellpadding="0">
              <tr>
                <td bgcolor="#FFFF99"> Stato del nodo: IN MODIFICA</td>
              </tr>
                <tr>
                <td>
                    <a
href="index.jsp?_cid=8d7a9a7d&_crc=6b71ca79">Termina le modifiche e
richiedi approvazione</a>
                </td>
                </tr>
            </table>
            <table width="100%"  border="0" cellpadding="0"
cellspacing="2" bgcolor="#C9C9E4">
      <tr>
        <td><a
href="ultimeModifiche.jsp?_cid=c133f3b9&_crc=63dbe2b">Ripristina
            le modifiche ai contenuti dall'ultima approvazionne</a></td>
      </tr>
      <tr>
        <td>
        <a
href="oldVersionIndex.jsp?_cid=3c9edcf&_crc=55e3afb3">Visualizza
versioni approvate precedenti</a>
        </td>
      </tr>
      <tr>
        <td>
        <a href="ripristina.jsp?_cid=84ec97d&_crc=86a7d2a1">Ripristina
versioni approvate precedenti</a>
        </td>
      </tr>
           </table>            <br>
            <table width="100%"  border="1" cellpadding="0"
cellspacing="2" bgcolor="#C5E8FC">
     <tr>
      <td>
              <a href="addnodo.jsp?_cid=7db569d7&_crc=c62e94b2">Aggiungi
nodo figlio</a>
      </td>
    </tr>
     <tr>
      <td>
          <a
href="index.jsp?_cid=868dd9e2&nome=WATtspostami&titolo=prova+per+spostamento&header=s&footer=s&cancellato=Y&_crc=dd5b90">Cancella 

questo nodo </a>
      </td>
    </tr>
<tr>
       <td>
             <a href="index.jsp?_cid=ba72735&_crc=19302dc">Sposta su</a>
      </td>
     </tr>
     <tr>
       <td>
           <span class="style1">Sposta giu</span>            </td>
     </tr>
    <tr>
       <td><a href="muovi.jsp">Muovi</a></td>
     </tr>

            </table>
            <br>
            <table width="100%"  border="1" cellpadding="0"
cellspacing="2" bgcolor="#66CCFF">

              <tr>
                <td>
                  <a href="commentiutenti.jsp">Commenti degli utenti</a>
                </td>
              </tr>
              <tr>
                <td>
                 <a href="noteredazione.jsp">Note di redazione
(visualizza e inserisci) </a>

                </td>
              </tr>
            </table>            <p>&nbsp;</p>
    <form action="index.jsp?_fid=F868dd9e2F&cancellato=N&_crc=7c7211f8"
method="POST" enctype="multipart/form-data" name="form1">
  <table border="0" cellspacing="4" cellpadding="2">
    <tr>
      <td colspan="2"><table width="100%"  border="0" cellspacing="2"
cellpadding="0">
        <tr>
          <td><b>id</b>: 169329879</td>
          <td><b>itemid</b>: 176797252</td>
        </tr>
        <tr>
          <td><b>parentid</b>: 195688698</td>
          <td><b>statoediting</b>: 1</td>
        </tr>
      </table></td>
      </tr>
      <td><b>nome</b></td>
      <td>
      <input name="nome" type="text" value="WATtspostami">
      </td>
    </tr>
      <td><b>titolo</b></td>
      <td>
      <input name="titolo" type="text" value="prova per spostamento"
size="60">
      </td>
    </tr>
      <td valign="top"><b>header</b></td>
      <td>
      <textarea name="header" cols="60" rows="6">s</textarea>
      </td>
    </tr>
      <td valign="top"><b>footer</b></td>
      <td>
      <textarea name="footer" cols="60" rows="6">s</textarea>
      </td>
    </tr>
      <td><b>ordinale</b></td>
      <td>4.000000000000000000000000000000</td>
    </tr>
      <td><b>parentPath</b></td>
      <td>/Root</td>
    </tr>
      <td><b>cancellato</b></td>
      <td>N</td>
    </tr>
        <td><b>Data ultima modifica: </b></td>
          <td>2004-04-27 08:54:21.59</td>
    </tr>
        <td><b>Data approvazione: </b></td>
          <td></td>
    </tr>
      <td><b>tipologia</b></td>
      <td>1</td>
    </tr>  <tr>
        <td>&nbsp;</td>
        <td><div align="right">
          <input type="button" name="Submit_orig" value="Salva
modifiche" onClick="doCheckNome()">
          <input type="submit" name="Submit" value="WATt Salva modifiche">
        </div></td>
      </tr>
  </table>
     </form>
            <p>
    Contenuti del nodo:
      <br>
      <br>
<table width="100%" border='0'>
</table>
<p><a href="/custom/contenuti/descrittivo/add.jsp">Aggiungi nuovo
oggetto descrittivo </a></p>
            </p>
                        </td>
          </tr>
        </table>
</body>
</html>

>Testing other times, I have partially solved  this problem:
><verifyxpath xpath="//a".../> fails, but  <verifyxpath xpath="//A".../>
>no. (See the results.html.)
> but... Why, if in the tested page I have a tag <a> and not <A>?


Some test performed  in this page are:
<verifyxpath stepid="verify xpath 0.1" xpath="//A"/> PASSED;
<verifyxpath stepid="verify xpath 3.1" xpath="//a"/>   FAILED;

<verifyxpath stepid="verify xpath 0.2"
xpath="//A[@href='index.jsp?_cid=ba72735&amp;_crc=19302dc']"/> PASSED;
<verifyxpath stepid="verify xpath 0.3" text="Logout" xpath="//A"/> PASSED;
<verifyxpath stepid="verify xpath 0.4" xpath="//A[@href='muovi.jsp']"/>
PASSED;
<verifyxpath stepid="verify xpath 0.5"
xpath="//a[@href='muovi.jsp']"/>   FAILED;

<verifyxpath stepid="verify xpath 1.1" text="Sposta su" xpath="//A"/>
FAILED;
<verifyxpath stepid="verify xpath 4.1" text="Sposta su" xpath="//a"/>
FAILED;

<verifyxpath stepid="verify xpath 2.1" xpath="//IMG"/>   PASSED;
<verifyxpath stepid="verify xpath 2.2"
xpath="//IMG[@src='/res/tree/modifica.gif']"/> PASSED;
<verifyxpath stepid="verify xpath 2.3" xpath="//img"/>   FAILED;



>Another question: see the report of test 2 and 6: 
>
>I'm searching a link
>with label "Sposta su" ("Move up") in the page. This link exists in the
>page, but the test fails (with xpath="//A" and with xpath="//a"). Why?
>because is in a "bad table"?
>  
>
(test 2 and 6 are the verifyxpath with stepid "verify xpath 1.1" and
"verify xpath 4.1")

thanks
max