# File lib/xpath/html.rb, line 46 def select(locator, options={}) xpath = locate_field(descendant(:select), locator) options[:options].each do |option| xpath = xpath[descendant(:option).equals(option)] end if options[:options] [options[:selected]].flatten.each do |option| xpath = xpath[descendant(:option)[attr(:selected)].equals(option)] end if options[:selected] xpath end