Hello, In the past I have attempted to save some typing by extinding the IE class so that I could create methods specific to my AUT, e.g.:
require 'watir' include Watir class Salesforce < IE def start self.goto("http://test.salesforce.com") end def login(username, password) self.text_field(:name, "username").set(username) self.text_field(:name, "password").set(password) self.button(:id, "Login").click end end This always worked just fine for me, but now I am trying to do the same exact thing with the Firefox class, but when it executes the line "self.text_field(:name, "username").set(username)", (called from a test script that is using a "Salesforce" object as the browser) I get a runtime error: 1) Error: test_start(TestLogin): NoMethodError: undefined method `element_name' for #<Salesforce: 0xb7209da8> /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/element.rb: 276:in `locate_tagged_element' /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/elements/ input_element.rb:22:in `locate' /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/element.rb: 964:in `exists?' /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/element.rb: 905:in `assert_exists' /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/elements/ text_field.rb:149:in `set' test_login.rb:17:in `test_start' "self.goto" works fine but once I access those text fields it throws an error. Am I doing something wrong, or is it just not possible to extend the Firefox class is this way? Thanks, Brian -- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general