Sha256: 3073a1c061f01ff7825ed2614a1d00426566749c315c6d4ba4a25f4249b90c1b

Contents?: true

Size: 545 Bytes

Versions: 3

Compression:

Stored size: 545 Bytes

Contents

# encoding: utf-8
module Watir
  class Button < HTMLElement

    # add the attributes from <input>
    attributes Watir::Input.typed_attributes

    def locate
      ButtonLocator.new(@parent.wd, @selector, self.class.attribute_list).locate
    end

    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

    def enabled?
      !disabled?
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
watir-webdriver-0.0.1.dev4 lib/watir-webdriver/elements/button.rb
watir-webdriver-0.0.1.dev3 lib/watir-webdriver/elements/button.rb
watir-webdriver-0.0.1.dev2 lib/watir-webdriver/elements/button.rb