# File lib/capybara/driver/rack_test_driver.rb, line 12
    def [](name)
      attr_name = name.to_s
      case
      when 'select' == tag_name && 'value' == attr_name
        if node['multiple'] == 'multiple'
          node.xpath(".//option[@selected='selected']").map { |option| option.content  }
        else
          option = node.xpath(".//option[@selected='selected']").first || node.xpath(".//option").first
          option.content if option
        end
      when 'input' == tag_name && 'checkbox' == type && 'checked' == attr_name
        node[attr_name] == 'checked' ? true : false
      else
        node[attr_name]
      end
    end