lib/watir-classic/xpath_locator.rb in watir-classic-3.7.0 vs lib/watir-classic/xpath_locator.rb in watir-classic-4.0.0

- old
+ new

@@ -27,11 +27,11 @@ end # execute xpath selector and return an array of elements def elements_by_xpath(xpath) doc = xmlparser_document_object - current_tag = @container.is_a?(IE) ? "body" : @container.tag_name + current_tag = @container.is_a?(Browser) ? "body" : @container.tag_name doc.xpath(xpath).reduce([]) do |elements, element| absolute_xpath_parts = element.path.split("/") first_tag_position = absolute_xpath_parts.index(current_tag) || absolute_xpath_parts.index("html") + 1 element_xpath_parts = absolute_xpath_parts[first_tag_position..-1] @@ -43,10 +43,10 @@ end.ole_object end end def direct_children container, elements - return elements if container.is_a?(IE) + return elements if container.is_a?(Browser) elements.select {|el| el.parent == container} end end end