<tbody>
<tr> </tr>
<tr>
<div>
<td><div><span class="logo" style="background-image: url(/images/logos/ab.gif);"></span>
<span class="pc_name">Apple</span></div></td>
<td> </td>
<td> </td>.............
<td><div><input type="image" class="book-btn" title="Book this" alt="Book this" src="/images/buttons/book.gif" tripid="7"/>
...................
<tbody>
<tr>...............................
I'm looking for the first instance of the text "Apple" or the image file "ab.gif" which could be in multiple <tbody>. I then want to click on a book button (book-btn) on the same row as this text found. The text is always on first cell and the book button is always on the 7th cell.
So far, I haven't been able to do so using xpath on FireWatir 1.6.2. Tried some examples given by Angrez and others, but it still is not working:
ff.button(:xpath, "//span[@text='Apple']/../td[7]/div/input").click()
ff.button(:xpath, "//[contains(text(),'Apple')]/../td[7]/input").click()
Both give an error saying "Unable to locate element, using :xpath...". Am I doing something wrong here?
Any help appreciated!
Thanks,
Usha