module Symbiont module WebObjects class SelectList < WebObject def initialize(web_object, platform) @web_object = web_object include_platform_specifics_for(platform) end def self.usable_selectors_for_watir super + [:value, :text] end protected def option_xpath ".//child::option" end def include_platform_specifics_for(platform) super if platform[:platform] == :watir_webdriver require 'symbiont/platform_watir/web_objects/select_list' self.class.send :include, Symbiont::Platforms::WatirWebDriver::SelectList elsif platform[:platform] == :selenium_webdriver require 'symbiont/platform_selenium/web_objects/select_list' self.class.send :include, Symbiont::Platforms::SeleniumWebDriver::SelectList else raise ArgumentError, "The platform #{platform[:platform]} appears to be unsupported." end end end # class: SelectList ::Symbiont::WebObjects.class_for_tag[:select] = ::Symbiont::WebObjects::SelectList end # module: WebObjects end # module: Symbiont