unknownbits
unknownbits

Reputation: 2885

how to get data from td in watir which looks like " status"

<td align="Left">

<font color="navy">

<b>Status &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     &nbsp;&nbsp; : </b>

</font>

<font color="red"><b>Registered</b>
</font>

</td>

i want to do this

if(cell.text==like(status))
  puts "yes"
end

actually in my table there are random tr and td , so i want to fetch the text of td which have status text in it. because it is fixed and "Registered" text may be change. so on the basis of %status% i want to select the td.

Upvotes: 3

Views: 367

Answers (1)

p0deje
p0deje

Reputation: 4063

You can locate element by regular expression:

browser.td(:text => /^Status/)

Upvotes: 5

Related Questions