how to click on Login button with code like this ?

0 views
Skip to first unread message

Chary Kanaparthi

unread,
Nov 1, 2007, 5:01:52 PM11/1/07
to watir-...@googlegroups.com
<form method="post" action="/profile/login">
<div class="legend">
</div>
<div class="field">
</div>
<div class="field">
</div>
<div class="buttons">
<input id="login" type="hidden" value="login" name="login"/>
<div class="buttonActive" style="width: 95px;"
onclick="document.getElementById('login').form.submit()">
<div class="buttonActiveLeft"/>
<div class="buttonText">LOG IN</div>
<div class="buttonActiveRight"/>
</div>
</div>
</form>

Thanks,
Chary

Paul Rogers

unread,
Nov 1, 2007, 5:08:12 PM11/1/07
to watir-...@googlegroups.com
ie.div(:class "buttonActive").click

should do it

Charley Baker

unread,
Nov 1, 2007, 5:29:51 PM11/1/07
to watir-...@googlegroups.com
Your login button is hidden perhaps expecting information in the form before becoming visible? Try firing an event on the div.

browser.div(:class, 'buttonActive').fire_event('onclick')

-Charley

On 11/1/07, Chary Kanaparthi <Chary.Ka...@sun.com> wrote:

Roberto Decurnex Gorosito

unread,
Nov 2, 2007, 8:40:52 AM11/2/07
to Watir General
4 ways of cliking the button

ie.button( :id, 'login' ).click

or

ie.button( :value, 'login' ).click

or

ie.button( :name, 'login' ).click

or probably

ie.button( :text, 'login' ).click

If you have more than one button with the same :id, :name or any
identifyer you like you can use the methods like this:

ie.button( :name => 'login', :id => 'login' ).click

Reply all
Reply to author
Forward
0 new messages