click inside cell

1 view
Skip to first unread message

alex

unread,
Sep 6, 2007, 11:58:52 AM9/6/07
to Watir General
Hi,
How to find and click on the object if it inside the cell?
There is the piece of code:
<td align="right" class="f12n">Password`</td>
<td nowrap class="f16b">
<input type="password" name="password" maxlength="32" size="20"
value=" " onkeypress="returnKeyHandler(event);" onfocus="
this.select();" class="f14n">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color="#0000FF" onClick="goLogin();"
onMouseOut="hoverLink(this,0);" onMouseOver="hoverLink(this,1,'Click
to login');">Sign In</font>

When I use:
ie.cell(:text, "Sign In").flash
watir understand this full cell (included: password label, password
text field and Sign In).
I have to click on Sign In, how to find this object?

Charley Baker

unread,
Sep 6, 2007, 12:43:38 PM9/6/07
to watir-...@googlegroups.com
This works for me with a simple version of your cell, there may be an easier way, I don't know, it's the first thing I came up with:

browser.cell(:text, 'Sign In').document.childnodes.item(1).fireevent('onclick')

Then you tell your developers that font tags are deprecated and never to do anything so heinous again. :)

-Charley

Bret Pettichord

unread,
Sep 6, 2007, 1:33:31 PM9/6/07
to watir-...@googlegroups.com
Charley Baker wrote:
> This works for me with a simple version of your cell, there may be an
> easier way, I don't know, it's the first thing I came up with:
>
> browser.cell(:text, 'Sign
> In').document.childnodes.item(1).fireevent('onclick')
>
> Then you tell your developers that font tags are deprecated and never
> to do anything so heinous again. :)
This is a good argument for providing a generic ie.element() method that
would work with any type of element.

Bret

alex

unread,
Sep 6, 2007, 3:09:00 PM9/6/07
to Watir General
After: ie.cell(:text, 'Sign
In').document.childnodes.item(1).fireevent('onclick')
I recieved next message:
Search_User.rb:33:in `method_missing': unknown property or method
`fireevent' (WIN32OLERuntimeError)
HRESULT error code:0x80020006
Unknown name. from Search_User.rb:33

Charley Baker

unread,
Sep 6, 2007, 3:28:34 PM9/6/07
to watir-...@googlegroups.com
You may have to change the child node, it may not be 1 in the array you get back, dunno. And I'd hope you are working with Watir 1.5.x.

-c

On 9/6/07, alex <alex.ba...@gmail.com> wrote:

alex

unread,
Sep 6, 2007, 4:20:54 PM9/6/07
to Watir General
It works.
Thanks a lot!

On Sep 6, 3:28 pm, "Charley Baker" <charley.ba...@gmail.com> wrote:
> You may have to change the child node, it may not be 1 in the array you get
> back, dunno. And I'd hope you are working with Watir 1.5.x.
>
> -c
>

> On 9/6/07, alex <alex.barsht...@gmail.com> wrote:
>
>
>
>
>
> > After: ie.cell(:text, 'Sign
> > In').document.childnodes.item(1).fireevent('onclick')
> > I recieved next message:
> > Search_User.rb:33:in `method_missing': unknown property or method
> > `fireevent' (WIN32OLERuntimeError)
> > HRESULT error code:0x80020006
> > Unknown name. from Search_User.rb:33
>
> > On Sep 6, 1:33 pm, Bret Pettichord <b...@pettichord.com> wrote:
> > > Charley Baker wrote:
> > > > This works for me with a simple version of your cell, there may be an
> > > > easier way, I don't know, it's the first thing I came up with:
>
> > > > browser.cell(:text, 'Sign
> > > > In').document.childnodes.item(1).fireevent('onclick')
>
> > > > Then you tell your developers that font tags are deprecated and never
> > > > to do anything so heinous again. :)
>
> > > This is a good argument for providing a generic ie.element() method that
> > > would work with any type of element.
>

> > > Bret- Hide quoted text -
>
> - Show quoted text -

Reply all
Reply to author
Forward
0 new messages