Sha256: 27ee809d231db79b2d6a98b87f8665daf5aacb518f5ee42cc1671c588784dcbb
Contents?: true
Size: 959 Bytes
Versions: 2
Compression:
Stored size: 959 Bytes
Contents
# encoding: utf-8 module Watir # # Class representing button elements. # # This class covers both <button> and <input type="submit|reset|image|button" /> elements. # class Button < HTMLElement # add the attributes from <input> attributes Watir::Input.typed_attributes # # Returns the text of the button. # # For input elements, returns the "value" attribute. # For button elements, returns the inner text. # def text assert_exists case @element.tag_name when 'input' value when 'button' text else raise Exception::Error, "unknown tag name for button: #{@element.tag_name}" end end # # Returns true if this element is enabled # # @return [Boolean] # def enabled? !disabled? end private def locate ButtonLocator.new(@parent.wd, @selector, self.class.attribute_list).locate end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
watir-webdriver-0.0.1.dev6 | lib/watir-webdriver/elements/button.rb |
watir-webdriver-0.0.1.dev5 | lib/watir-webdriver/elements/button.rb |