Sha256: 1ff6183742dfd20b79535e0a8dee3c46ef7575b76b7504426991b7f488d7e851
Contents?: true
Size: 645 Bytes
Versions: 17
Compression:
Stored size: 645 Bytes
Contents
# encoding: utf-8 module Watir module XpathSupport include Selenium # # Find the first element matching the given XPath # def element_by_xpath(xpath) e = wd.find_element(:xpath, xpath) Watir.element_class_for(e.tag_name).new(self, :element => e) rescue WebDriver::Error::NoSuchElementError Element.new(self, :xpath => xpath) end # # Find all elements matching the given XPath # def elements_by_xpath(xpath) wd.find_elements(:xpath, xpath).map do |e| Watir.element_class_for(e.tag_name).new(self, :element => e) end end end # XpathSupport end # Watir
Version data entries
17 entries across 17 versions & 2 rubygems