# Undefined method \`element\_name', dubble inherit

**URL:** <https://www.ruby-forum.com/t/undefined-method-element-name-dubble-inherit/148930>\
**Category:** Ruby\
**Created:** [September 18, 2008, 12:57pm UTC](https://www.ruby-forum.com/t/undefined-method-element-name-dubble-inherit/148930 "2008-09-18T12:57:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flamingflamingo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f14d63/32.png) [@flamingflamingo](https://www.ruby-forum.com/u/flamingflamingo)\
**Post date:** [September 18, 2008, 12:57pm UTC](https://www.ruby-forum.com/t/undefined-method-element-name-dubble-inherit/148930/1 "2008-09-18T12:57:30Z")

</div>

Dear all,  
I’m making a class that can handle IE as well as FF.  
This class is used for our scripts.

When I call this class I can call own def’s and standard def goto,  
but, not “link”.  
I made two “scripts”, first goes wrong second goes right.

See code:  
class BFF \< Firefox

```
    def ggoto(url)
            puts self
            self.goto(url)
    end
    def checklinks
            puts self
            puts self.links.length
    end
    def clicklink
            self.link(:href, "/news/1749816/10/

```

Veel\_steden\_zondag\_autovrij.html").click  
end

```
    def talk
            puts "talking FF"
    end

```

end

class Browser

```
    def initialize
            @strBType = "FF"

            end

     def BrowserChoice()
            # case select
              # what browser in start.xls
            # end
            puts "in browserchoice"
             test = BFF.new

             return test
     end

```

end

#link goes wrong.  
browserr = Browser.new.BrowserChoice  
puts browserr  
browserr.talk()  
browserr.goto(“[http://www.nu.nl](http://www.nu.nl)”)  
browserr.checklinks  
browserr.clicklink  
browserr.link(:href, “/news/1749816/10/  
Veel\_steden\_zondag\_autovrij.html”).click  
#puts browser.links.length

#link works  
ff = FireWatir::Firefox.new()  
ff.goto(“[http://www.nu.nl](http://www.nu.nl)”)  
puts ff.links.length  
ff.link(:href, “/news/1749816/10/  
Veel\_steden\_zondag\_autovrij.html”).click
