Module: Appium::Core::Base::SearchContext
- Included in:
- Driver
- Defined in:
- lib/appium_lib_core/common/base/search_context.rb
Constant Summary collapse
- FINDERS =
referenced: ::Selenium::WebDriver::SearchContext
::Selenium::WebDriver::SearchContext::FINDERS.merge(accessibility_id: 'accessibility id')
Class Method Summary collapse
Instance Method Summary collapse
-
#find_element(*args) ⇒ Element
Find the first element matching the given arguments.
-
#find_elements(*args) ⇒ Object
Find all elements matching the given arguments.
Class Method Details
.add_finders(finders) ⇒ Object
9 10 11 |
# File 'lib/appium_lib_core/common/base/search_context.rb', line 9 def self.add_finders(finders) FINDERS.merge!(finders) end |
Instance Method Details
#find_element(how, what) ⇒ Element #find_element(opts) ⇒ Element
Find the first element matching the given arguments
30 31 32 33 34 35 36 37 38 |
# File 'lib/appium_lib_core/common/base/search_context.rb', line 30 def find_element(*args) how, what = extract_args(args) by = _set_by_from_finders(how) begin bridge.find_element_by by, what.to_s, ref rescue Selenium::WebDriver::Error::TimeOutError raise Selenium::WebDriver::Error::NoSuchElementError end end |
#find_elements(*args) ⇒ Object
Find all elements matching the given arguments
45 46 47 48 49 50 51 52 53 |
# File 'lib/appium_lib_core/common/base/search_context.rb', line 45 def find_elements(*args) how, what = extract_args(args) by = _set_by_from_finders(how) begin bridge.find_elements_by by, what.to_s, ref rescue Selenium::WebDriver::Error::TimeOutError raise Selenium::WebDriver::Error::NoSuchElementError end end |