Sha256: a3d41f1a9b7849ce5b4494ce0d8fe616fe4ae1d353f914bd1d761b0e2a35943c
Contents?: true
Size: 745 Bytes
Versions: 1
Compression:
Stored size: 745 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 BaseElement.new(self, :xpath, xpath) end # # Find all elements matching the given XPath # def elements_by_xpath(xpath) # TODO: find the correct element class wd.find_elements(:xpath, xpath).map do |e| Watir.element_class_for(e.tag_name).new(self, :element, e) end rescue WebDriver::Error::NoSuchElementError [] end end # XpathSupport end # Watir
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
watir-webdriver-0.0.1.dev6 | lib/watir-webdriver/xpath_support.rb |