# How to click the Buttons in Forms

**URL:** <https://www.ruby-forum.com/t/how-to-click-the-buttons-in-forms/68329>\
**Category:** Ruby\
**Created:** [September 11, 2006, 8:02pm UTC](https://www.ruby-forum.com/t/how-to-click-the-buttons-in-forms/68329 "2006-09-11T20:02:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ban\_Hoang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@Ban\_Hoang](https://www.ruby-forum.com/u/Ban_Hoang)\
**Post date:** [September 11, 2006, 8:02pm UTC](https://www.ruby-forum.com/t/how-to-click-the-buttons-in-forms/68329/1 "2006-09-11T20:02:50Z")

</div>

Hi ,

I try to write the code to click the button in form but it keep give me  
errors. Any one have any idea how to make it work? Thanks!

* * *

Below is the code:

$ie.frame(“bottom”).button(:value, “:: Login \>”).click

* * *

HTMl source: ( this is frame\_bottom)

```
    <tr>

      <td align=left><input name=email type=text value=""

```

class=field size=15 maxlength=50\>

```
      <td align=left><font face=verdana size=1>&nbsp;</font><input

```

name=password type=password value="" class=field size=15  
maxlength=50\>

```
      <td align=left><font face=verdana size=1>&nbsp;</font><input

```

type=submit value=":: Login \>" class=button\>

```
    </tr>

```

This is the error I got:

1. Error:

test\_01\_LoginTestCase(TC\_pulldownBox\_Links\_Clicks):

Watir::Exception::UnknownObjectException: Unable to locate object, using  
value and :: Login \>

```
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists'

c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click'

Login_test1.rb:25:in `test_01_LoginTestCase'

```

1 tests, 0 assertions, 0 failures, 1 errors

---

<div class="post-metadata">

**Author:** ![Ban\_Hoang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@Ban\_Hoang](https://www.ruby-forum.com/u/Ban_Hoang)\
**Post date:** [September 11, 2006, 9:35pm UTC](https://www.ruby-forum.com/t/how-to-click-the-buttons-in-forms/68329/2 "2006-09-11T21:35:48Z")

</div>

Ban Hoang wrote:

> Hi ,  
> $ie.frame(“bottom”).button(:value, “:: Login \>”).click  
> HTMl source: ( this is frame\_bottom)
> 
> ```
> <tr>
> 
> <td align=left><input name=email type=text value=""
> 
> ```
> 
> class=field size=15 maxlength=50\>
> 
> ```
> <td align=left><font face=verdana size=1>&nbsp;</font><input
> 
> ```
> 
> name=password type=password value="" class=field size=15  
> maxlength=50\>
> 
> ```
> <td align=left><font face=verdana size=1>&nbsp;</font><input
> 
> ```
> 
> type=submit value=":: Login \>" class=button\>
> 
> ```
> </tr>
> 
> ```
> 
> 1. Error:
> 
> test\_01\_LoginTestCase(TC\_pulldownBox\_Links\_Clicks):
> 
> Watir::Exception::UnknownObjectException: Unable to locate object, using  
> value and :: Login \>
> 
> ```
> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists'
> 
> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click'
> 
> Login_test1.rb:25:in `test_01_LoginTestCase'
> 
> ```

Just for S&G, try…

$ie.frame(“bottom”).button(:value, /Login/).click

Better yet, just call the .submit() method of the form itself.
