lib/watir/locator.rb in watir-1.6.6 vs lib/watir/locator.rb in watir-1.6.7.rc1
- old
+ new
@@ -87,18 +87,19 @@
end
end
class InputElementLocator < Locator
- attr_accessor :document, :element, :elements
+ attr_accessor :document, :element, :elements, :klass
def initialize container, types
@container = container
@types = types
@elements = nil
+ @klass = Element
end
-
+
def specifier= arg
how, what, value = arg
if how.class == Hash and what.nil?
specifiers = how
@@ -115,10 +116,16 @@
end
def locate
count = 0
@elements.each do |object|
- element = Element.new(object)
+ if @klass == Element
+ element = Element.new(object)
+ else
+ element = @klass.new(@container, @specifiers, nil)
+ element.ole_object = object
+ def element.locate; @o; end
+ end
catch :next_element do
throw :next_element unless @types.include?(element.type)
@specifiers.each do |how, what|
next if how == :index