[Webtest] How to parse table data and click based on a matching table value.
q a
q a" <qalab17@gmail.com
Fri, 4 Jan 2008 12:31:44 -0800
------=_Part_25158_21450581.1199478704180
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
I am wondering if it is possible to do the following from a webtest
testcase:
I have a webpage containing a table with 2 columns, 1st column contains a
filename, 2nd column contains a link.
I would like to create a webtest that searches the 1st column, checks the
filename against the current date, and if it matches, to click on the link.
(The number of rows is variable, the number of columns is constant)
For example:
<table border="1">
<thead><tr><th class="tableHeader">Filename</th><th
class="tableHeader">Status</th></tr></thead>
<tbody id="swdlform:apptab:_idJsp71:tbody_element"
<tr><td>20080102.tar.gz</td><td><a href="#" onclick="return
oamSubmitForm('20080102');" id="idJsp71:18">Click</a></td></tr>
<tr><td>20080103.tar.gz</td><td><a href="#" onclick="return
oamSubmitForm('20080103');" id="idJsp71:19">Click</a></td></tr>
.
.
.
</tbody>
</table>
Is this possible?
If it is, an example would be greatly appreciated - I am brand new to
webtest.
Thanks for the help
------=_Part_25158_21450581.1199478704180
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi, <br><br>I am wondering if it is possible to do the following from a webtest testcase: <br><br>I have a webpage containing a table with 2 columns, 1st column contains a filename, 2nd column contains a link.<br>I would like to create a webtest that searches the 1st column, checks the filename against the current date, and if it matches, to click on the link.
<br>(The number of rows is variable, the number of columns is constant) <br><br>For example:<br><pre id="line242"><<span class="start-tag">table</span><span class="attribute-name"> border</span>=<span class="attribute-value">
"1"</span>><br><<span class="start-tag">thead</span>><<span class="start-tag">tr</span>><<span class="start-tag">th</span><span class="attribute-name"> class</span>=<span class="attribute-value">
"tableHeader"</span>>Filename</<span class="end-tag">th</span>><<span class="start-tag">th</span><span class="attribute-name"> class</span>=<span class="attribute-value">"tableHeader"</span>
>Status</<span class="end-tag">th</span>></<span class="end-tag">tr</span>></<span class="end-tag">thead</span>><br><<span class="start-tag">tbody</span><span class="attribute-name"> id</span>=<span class="attribute-value">
"swdlform:apptab:_idJsp71:tbody_element"</span><br><<span class="start-tag">tr</span>><<span class="start-tag">td</span>>20080102.tar.gz</<span class="end-tag">td</span>><<span class="start-tag">
td</span>><<span class="start-tag">a</span><span class="attribute-name"> href</span>=<span class="attribute-value">"#" </span><span class="attribute-name">onclick</span>=<span class="attribute-value">"return oamSubmitForm('20080102');"
</span><span class="attribute-name">id</span>=<span class="attribute-value">"idJsp71:18"</span>>Click</<span class="end-tag">a</span>></<span class="end-tag">td</span>></<span class="end-tag">tr
</span>><br><<span class="start-tag">tr</span>><<span class="start-tag">td</span>>20080103.tar.gz</<span class="end-tag">td</span>><<span class="start-tag">td</span>><<span class="start-tag">
a</span><span class="attribute-name"> href</span>=<span class="attribute-value">"#" </span><span class="attribute-name">onclick</span>=<span class="attribute-value">"return oamSubmitForm('20080103');"
</span><span class="attribute-name">id</span>=<span class="attribute-value">"idJsp71:19"</span>>Click</<span class="end-tag">a</span>></<span class="end-tag">td</span>></<span class="end-tag">tr
</span>><br>.<br>.<br>.<br><br></<span class="end-tag">tbody</span>><br></<span class="end-tag">table</span>><br></pre>Is this possible?<br>If it is, an example would be greatly appreciated - I am brand new to webtest.
<br><br>Thanks for the help<br><br><br>
------=_Part_25158_21450581.1199478704180--