Webtest/Xpath issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hurstbp
    New Member
    • Jun 2008
    • 3

    Webtest/Xpath issue

    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">lin k</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]
  • AricC
    Recognized Expert Top Contributor
    • Oct 2006
    • 1885

    #2
    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

    Comment

    • AricC
      Recognized Expert Top Contributor
      • Oct 2006
      • 1885

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

      Comment

      Working...