def to_subtype
      tag = tag_name()
      klass = if tag == 'input'
                case attribute_value(:type)
                when 'checkbox'
                  CheckBox
                when 'radio'
                  Radio
                when 'file'
                  FileField
                when *Button::VALID_TYPES
                  Button
                else
                  TextField
                end
              else
                Watir.element_class_for(tag)
              end

      klass.new(@query_scope, @selector).tap { |el| el.cache = wd }
    end
def to_subtype
      tag = tag_name()
      klass = if tag == 'input'
                case attribute_value(:type)
                when 'checkbox'
                  CheckBox
                when 'radio'
                  Radio
                when 'file'
                  FileField
                when *Button::VALID_TYPES
                  Button
                else
                  TextField
                end
              else
                Watir.element_class_for(tag)
              end

      klass.new(@query_scope, @selector).tap { |el| el.cache = wd }
    end
Cast this Element instance to a more specific subtype.

 @example
   browser.element(xpath: "//input[@type='submit']").to_subtype
   #=> #<Watir::Button>