Connecting Tech Pros Worldwide Forums | Help | Site Map

Webtest/Xpath issue

Newbie
 
Join Date: Jun 2008
Posts: 3
#1: Jun 27 '08
Hello,

I'm writing test scripts in Canoo's WebTest. Basically, I need to run through a table of data and find an ID number for a specific case, then follow the link for that case's details page, which is located in a different cell along the same row. Xpath works in other test scripts I've written, finding links that exist always in the same location, but may have different urls driving them. Thank you for your help.

Basically:
I want to use xpath to reference a link in a table cell based on the location of a cell containing a related string two columns to the right along the same row. To clarify:

<table>
<tbody>
<tr>
<td><a href="link">link</a></td> <-- I want to point to a[1] in this cell
<td> </td>
<td>string</td> by referencing this string's td predicate -2
</tr>
</tbody>
</table>

This is my xpath expression so far. It obviously doesn't work:

//td[contains(text(), 'string')-2]/a[1]
Expert
 
Join Date: Oct 2006
Location: NC
Posts: 1,722
#2: Jun 28 '08

re: Webtest/Xpath issue


This isn't an HTML issue therefore you are posting in the wrong forum. You should post more code in the forum below:

http://bytes.com/forum/forum145.html
Expert
 
Join Date: Oct 2006
Location: NC
Posts: 1,722
#3: Jun 28 '08

re: Webtest/Xpath issue


What language are you using xpath with you seem to be a bit off as well.
Reply