Class: Watizzle::Locators::Element::Locator

Inherits:
Watir::Locators::Element::Locator
  • Object
show all
Defined in:
lib/watizzle/locators/element/locator.rb

Constant Summary collapse

SIZZLE_LOADER_PATH =
File.expand_path('../../../sizzle/loader.js.erb', __FILE__)

Instance Method Summary collapse

Instance Method Details

#locateObject



9
10
11
12
13
14
15
# File 'lib/watizzle/locators/element/locator.rb', line 9

def locate
  e = by_id and return e # short-circuit if :id is given
  element = find_first_by_multiple
  element_validator.validate(element, @selector) if element
rescue Selenium::WebDriver::Error::NoSuchElementError, Selenium::WebDriver::Error::StaleElementReferenceError
  nil
end

#locate_allObject



17
18
19
# File 'lib/watizzle/locators/element/locator.rb', line 17

def locate_all
  find_all_by_multiple
end