As a cell is a container, you can use:

cell.image(:index, 1)

To access the first image within the cell. You should be able to use  
any of the other recognition methods, as usual.

Hope this helps,

Alex

On 22 Oct 2008, at 22:33, niartseoj <[EMAIL PROTECTED]> wrote:

>
> Hello,
>
> I am using the following code to go through my table and find a cell
> with a text condition. The looping works fine; however i'm trying to
> determine how i would then lookup an img an a link that are children
> of the cell.
>
> here is what i have so far..
>
> t = ie.table(:index,  7)    # since we don't have ID's or names I have
> to use the index
>  for i in 1..t.row_count
>    t[i].each do |cell|
>      if cell.text == _userid.to_s
>        puts cell.text
>        # want to check for img src== condition for this cell and then
> if true
>        # want to click the link in the cell
>    end
>  end
> end
>
> Here is sample of my htlm
>
> <TR align="left" bgColor="#e6e6e6">
>  <TD id="cell" >
>      <A href="userProfile.do?USER_EDIT=15293">smitha</A>
>      <IMG height="16" src="/icon_enabled.gif" /></TD>
>  <TD id="cell" vAlign="middle" align="center" width="105">Aimie Smith
> </TD>
>  <TD id="cell" vAlign="middle" align="center" width="60"
> bgColor="#e6e6e6">Full Time</TD>
> </TR>
> <TR align="left" bgColor="#e6e6e6">
>  <TD id="cell" >
>      <A href="userProfile.do?USER_EDIT=15294">smithj</A>
>      <IMG height="16" src="/icon_enabled.gif" /></TD>
>  <TD id="cell" vAlign="middle" align="center" width="105">Joe Smith </
> TD>
>  <TD id="cell" vAlign="middle" align="center" width="60"
> bgColor="#e6e6e6">Full Time</TD>
> </TR>
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to