Apologies, that code just demonstrates that xpath isn't working right.
I was trying to use .exists? in my code, but the example just is to
demonstrate that the xpath doesn't work at all. If you try to
do .exists? on a form element using xpath, it fails the same way.

--Kevin

On Mar 5, 3:48 pm, Kevin White <[email protected]> wrote:
> Here is a piece of code that doesn't work in FireWatir 1.6.2:
>
> require 'watir'
>
> Watir::Browser.default = 'firefox'
> browser = Watir::Browser.new
>
> browser.goto("http://www.google.com";)
>
> searchform = browser.form(:xpath, "//fo...@name='f']")
>
> puts "Searchform is #{searchform.to_s}"
>
> You will get this output:
>
> >ruby firewatirbug.rb
>
> C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> MozillaBaseElement.rb:1403:in `method_missing': stack level too deep
> (SystemStackError)
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> htmlelements.rb:75:in `locate'
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> MozillaBaseElement.rb:1012:in `exists?'
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> MozillaBaseElement.rb:965:in `assert_exists'
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> MozillaBaseElement.rb:1403:in `method_missing'
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> htmlelements.rb:75:in `locate'
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> MozillaBaseElement.rb:1012:in `exists?'
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> MozillaBaseElement.rb:965:in `assert_exists'
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> MozillaBaseElement.rb:1403:in `method_missing'
>          ... 9453 levels...
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> MozillaBaseElement.rb:1012:in `exists?'
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> MozillaBaseElement.rb:965:in `assert_exists'
>         from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/
> MozillaBaseElement.rb:1097:in `to_s'
>         from firewatirbug.rb:10
>
> Now, I found something on the net that says that this bug was fixed
> way back in 2007:
>
> http://code.google.com/p/firewatir/issues/detail?id=36
>
> So is it fixed, did it recur, is my installation broken, ???
>
> I've coded around it using element.attribute_value() but I really
> wanted to use the xpath instead.
>
> --Kevin White
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to