[Webtest] Am I using XPATH correctly?
webtest@lists.canoo.com
webtest@lists.canoo.com
Thu, 13 Jul 2006 13:11:30 -0400
----------MailBlocks_8C874B684C819DD_15B4_523B_FWM-R15.sysops.aol.com
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hello all,
I have a webpage I am trying to use WebTest/XPATH to extract a value. I've cut-and-pasted the html in this post. I've confirmed the XPATH is correct using XPATH Explorer and Stylus tools.
Here are some things I've seen:
- The value I'm trying to grab is within a bold tag
- The value is preceeded and succeeded by embedded tab characters (I can't change)
Here's the XPATH (I've also removed the string function and given an absolute path - no change):
string(//div[@id='etContent']/form[1]/table[1]/tr[2]/td[2]/div[1]/table[1]/tr[1]/td[1]/table[2]/tr[1]/td[1]/table[1]/tr[1]/td[2]/font[1]/b[1])
My WebTest script does not report an error but, instead, appears to show a blank value (could this be the result of the tab?)
Is this an XPATH 1.0 vs. 2.0 issue? Does WebTest use XPATH 1.0 or 2.0?
I'm stumped - help, please.
Thanks
-----------------
<table border="0" cellpadding="3" cellspacing="1" width=100% bgcolor="#999999">
<tr>
<td bgcolor="#cccccc" height="30"><b>Last<br>Price</b></td>
<td nowrap bgcolor="#ffffcc"><font size="3"><b>
14.20
</b></font>
</td>
---------------------
________________________________________________________________________
Check out AOL.com today. Breaking news, video search, pictures, email and IM. All on demand. Always Free.
----------MailBlocks_8C874B684C819DD_15B4_523B_FWM-R15.sysops.aol.com
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit
<HTML><BODY>
<div>Hello all,</div>
<div> </div>
<div>I have a webpage I am trying to use WebTest/XPATH to extract a value. I've cut-and-pasted the html in this post. I've confirmed the XPATH is correct using XPATH Explorer and Stylus tools.</div>
<div> </div>
<div>Here are some things I've seen:</div>
<div>- The value I'm trying to grab is within a bold tag</div>
<div>- The value is preceeded and succeeded by embedded tab characters (I can't change)</div>
<div> </div>
<div>Here's the XPATH (I've also removed the string function and given an absolute path - no change):</div>
<div><FONT size=2>
<div>string(//div[@id='etContent']/form[1]/table[1]/tr[2]/td[2]/div[1]/table[1]/tr[1]/td[1]/table[2]/tr[1]/td[1]/table[1]/tr[1]/td[2]/font[1]/b[1])</div>
</FONT></div>
<div> </div>
<div>My WebTest script does not report an error but, instead, appears to show a blank value (could this be the result of the tab?)</div>
<div> </div>
<div>Is this an XPATH 1.0 vs. 2.0 issue? Does WebTest use XPATH 1.0 or 2.0?</div>
<div> </div>
<div>I'm stumped - help, please.</div>
<div> </div>
<div>Thanks</div>
<div> </div>
<div> </div>
<div>-----------------</div>
<div><FONT size=2>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><table border="0" cellpadding="3" cellspacing="1" width=100% bgcolor="#999999"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1"> </SPAN><tr><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2"> </SPAN><td bgcolor="#cccccc" height="30"><b>Last<br>Price</b></td><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2"> </SPAN><td nowrap bgcolor="#ffffcc"><font size="3"><b><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3"> </SPAN><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 4"> </SPAN><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 5"> </SPAN><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 6"> </SPAN><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 6"> </SPAN><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 7"> </SPAN>14.20<o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 6"> </SPAN><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 5"> </SPAN><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 4"> </SPAN><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 4"> </SPAN><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3"> </SPAN><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2"> </SPAN></b></font><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2"> </SPAN></td><o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3> </FONT></o:p></div>
<div>---------------------</div>
</FONT></div>
<div class="AOLPromoFooter">
<hr style="margin-top:10px;" />
<a href="http://pr.atwola.com/promoclk/1615326657x4311227241x4298082137/aol?redir=http%3A%2F%2Fwww%2Eaol%2Ecom" target="_blank"><b>Check out AOL.com today</b></a>. Breaking news, video search, pictures, email and IM. All on demand. Always Free.<br />
</div>
</BODY></HTML>
----------MailBlocks_8C874B684C819DD_15B4_523B_FWM-R15.sysops.aol.com--