Sha256: 7f88d3399040ea750900ac9b5d08f54da7c3569d657a787fb7014a57e3e44ccc

Contents?: true

Size: 761 Bytes

Versions: 1

Compression:

Stored size: 761 Bytes

Contents

# encoding: utf-8
module Watir
  class Input

    alias_method :readonly?, :read_only?

    def enabled?
      !disabled?
    end

    #
    # not sure about this
    #
    # this is mostly useful if you're using Browser#element_by_xpath, and want to
    # 'cast' the returned Input instance to one of the subclasses
    #

    def to_checkbox
      assert_exists
      Watir::CheckBox.new(@parent, :element, @element)
    end

    def to_radio
      assert_exists
      Watir::Radio.new(@parent, :element, @element)
    end

    def to_button
      assert_exists
      Watir::Button.new(@parent, :element, @element)
    end

    def to_select_list
      assert_exists
      Watir::SelectList.new(@parent, :element, @element)
    end

  end # Input
end # Watir

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-webdriver-0.0.1.dev lib/watir-webdriver/elements/input.rb