# Firewatir question

**URL:** <https://rubytalk.org/t/firewatir-question/53868>\
**Category:** ruby-talk\
**Created:** [11 June 2009 21:21 UTC](https://rubytalk.org/t/firewatir-question/53868 "2009-06-11T21:21:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axel\_Etzold](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Axel\_Etzold](https://rubytalk.org/u/Axel_Etzold)\
**Post date:** [11 June 2009 21:21 UTC](https://rubytalk.org/t/firewatir-question/53868/1 "2009-06-11T21:21:16Z")

</div>

Dear all,

I am trying to automate some javascript website using Firewatir.  
I use the following code :

require 'rubygems'  
require 'firewatir'  
include FireWatir  
test\_site="[http://konjugator.reverso.net/konjugation-englisch.html](http://konjugator.reverso.net/konjugation-englisch.html)"  
ff=Firefox.new  
ff.goto(test\_site)  
ff.text\_field(:name,"ctl00$txtVerb").set("go")  
# everything is nice up to here, then I'd like to click the "Konjugieren" # button, which fails  
ff.button(:title,"Konjugieren").click  
ff.close

The second-to-last line gives the following error:

/usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/MozillaBaseElement.rb:967:in `assert\_exists': Unable to locate element, using :title, "Konjugieren" (Watir::Exception::UnknownObjectException)  
&nbsp;&nbsp;from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/MozillaBaseElement.rb:1112:in `click'  
&nbsp;&nbsp;from f.rb:11

... yet there's an element with :title 'Konjugieren' in the website that's generated when I enter the information by hand.  
What am I missing ?

Thank you very much!

Best regards,

Axel

> **···**
>
> --  
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!  
> Jetzt freischalten unter [http://portal.gmx.net/de/go/maxdome01](http://portal.gmx.net/de/go/maxdome01)

---

<div class="post-metadata">

**Author:** ![Jason\_Trebilcock](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@Jason\_Trebilcock](https://rubytalk.org/u/Jason_Trebilcock)\
**Post date:** [12 June 2009 01:23 UTC](https://rubytalk.org/t/firewatir-question/53868/2 "2009-06-12T01:23:02Z")

</div>

Comments below:

> From: Axel Etzold [mailto:AEtzold@gmx.de]  
> Sent: Thursday, June 11, 2009 4:21 PM  
> To: ruby-talk ML  
> Subject: Firewatir question
> 
> Dear all,
> 
> I am trying to automate some javascript website using Firewatir.  
> I use the following code :
> 
> require 'rubygems'  
> require 'firewatir'  
> include FireWatir  
> test\_site="[http://konjugator.reverso.net/konjugation-englisch.html&quot](http://konjugator.reverso.net/konjugation-englisch.html&quot);  
> ff=Firefox.new  
> ff.goto(test\_site)  
> ff.text\_field(:name,"ctl00$txtVerb").set("go")  
> # everything is nice up to here, then I'd like to click the  
> "Konjugieren" # button, which fails  
> ff.button(:title,"Konjugieren").click  
> ff.close
> 
> The second-to-last line gives the following error:
> 
> /usr/local/lib/ruby/gems/1.8/gems/firewatir-  
> 1.6.2/lib/firewatir/MozillaBaseElement.rb:967:in `assert\_exists':  
> Unable to locate element, using :title, "Konjugieren"  
> (Watir::Exception::UnknownObjectException)  
> &nbsp;&nbsp;from /usr/local/lib/ruby/gems/1.8/gems/firewatir-  
> 1.6.2/lib/firewatir/MozillaBaseElement.rb:1112:in `click'  
> &nbsp;&nbsp;from f.rb:11
> 
> ... yet there's an element with :title 'Konjugieren' in the website  
> that's generated when I enter the information by hand.  
> What am I missing ?
> 
> Thank you very much!
> 
> Best regards,
> 
> Axel  
> --

[Jason Trebilcock]

What you're running into is an object that looks like a button, but, for all  
intents and purposes, isn't a button. I've been trying to debug the above  
using Watir and am not having a whole lot of luck.

There is something at the following that looks like it might be of help:  
[http://rubyforge.org/pipermail/wtr-general/2006-January/004607.html](http://rubyforge.org/pipermail/wtr-general/2006-January/004607.html)

Beyond that, you might want to browse and ask the Watir group (if you  
haven't already done so):  
[http://groups.google.com/group/watir-general](http://groups.google.com/group/watir-general)

They should be able to help point you in a good direction.

Jason

> **···**
>
> > -----Original Message-----

---

<div class="post-metadata">

**Author:** ![John\_W\_Higgins1](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/john_w_higgins1/32/1922_2.png) [@John\_W\_Higgins1](https://rubytalk.org/u/John_W_Higgins1)\
**Post date:** [12 June 2009 02:05 UTC](https://rubytalk.org/t/firewatir-question/53868/3 "2009-06-12T02:05:32Z")

</div>

If you look at the source for your test page it's not a button but an \<a\>  
element that you are looking to click. Using this as a reference  
[http://wiki.openqa.org/display/WTR/HTML+Tags+and+Watir+Methods](http://wiki.openqa.org/display/WTR/HTML+Tags+and+Watir+Methods) you can find  
that for an \<a\> element you use the link method. So all you need to do is  
change button to link and you should be in business.

John

> **···**
>
> On Thu, Jun 11, 2009 at 2:21 PM, Axel Etzold \<AEtzold@gmx.de\> wrote:
> 
> > Dear all,
> > 
> > I am trying to automate some javascript website using Firewatir.  
> > I use the following code :
> > 
> > require 'rubygems'  
> > require 'firewatir'  
> > include FireWatir  
> > test\_site="[http://konjugator.reverso.net/konjugation-englisch.html&quot](http://konjugator.reverso.net/konjugation-englisch.html&quot);  
> > ff=Firefox.new  
> > ff.goto(test\_site)  
> > ff.text\_field(:name,"ctl00$txtVerb").set("go")  
> > # everything is nice up to here, then I'd like to click the "Konjugieren" #  
> > button, which fails  
> > ff.button(:title,"Konjugieren").click  
> > ff.close
