Module: Thoran::Selenium::WebDriver::SearchContext::ElementPresentQ

Included in:
Selenium::WebDriver::Driver
Defined in:
lib/Thoran/Selenium/WebDriver/SearchContext/ElementPresentQ/element_presentQ.rb

Instance Method Summary collapse

Instance Method Details

#element_present?(selector_type, selector) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
23
24
25
# File 'lib/Thoran/Selenium/WebDriver/SearchContext/ElementPresentQ/element_presentQ.rb', line 20

def element_present?(selector_type, selector)
  bridge.find_element_by(selector_type, selector)
  true
rescue ::Selenium::WebDriver::Error::NoSuchElementError
  false
end