From: Hassan Schroeder Date: 2010-05-27T02:48:53+09:00 Subject: Re: Watir - finding element in form On Tue, May 25, 2010 at 11:24 PM, Phil Mcdonnell wrote: > I'm trying to use Watir to log into a page.  I can't seem to find the > login button in order to click on it.  From the Watir examples I've read > it seems I need the following code: > browser.button(:alt, 'Login').click > > However, the final line doesn't do anything. > Here's the relavent html: >   alt="Login" style="margin-top:5;margin-left:20;margin-bottom:22" border > = "0" tabIndex='5' onClick="javascript:loginNow();return false;"> I've never used Watir, but a quick glance at the API has this for the "button" method -- "Used to access a button element. Usually an HTML tag." Which the form snippet above clearly is not. So I'm not sure why you expect this to work. :-) Either you have to find the appropriate method, or select that input element some other way. HTH, -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com twitter: @hassan