Module: Appium::Core::Ios::Xcuitest::SearchContext

Defined in:
lib/appium_lib_core/ios/xcuitest/search_context.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extendObject

Examples:


# select the third child button of the first child window element
find_elements :class_chain, 'XCUIElementTypeWindow/XCUIElementTypeButton[3]'

# select all the children windows
find_elements :class_chain, 'XCUIElementTypeWindow'

# select the second last child of the second child window
find_elements :class_chain, 'XCUIElementTypeWindow[2]/XCUIElementTypeAny[-2]'

# matching predicate. <code>`</code> is the mark.
find_elements :class_chain, 'XCUIElementTypeWindow[`visible = 1][`name = \"bla\"`]'

# containing predicate. `$` is the mark.
# Require appium-xcuitest-driver 2.54.0+
# PR: https://github.com/facebook/WebDriverAgent/pull/707/files
find_elements :class_chain, 'XCUIElementTypeWindow[$name = \"bla$$$bla\"$]'
e = find_element :class_chain, "**/XCUIElementTypeWindow[$name == 'Buttons'$]"
e.tag_name #=> "XCUIElementTypeWindow"
e = find_element :class_chain, "**/XCUIElementTypeStaticText[$name == 'Buttons'$]"
e.tag_name #=> "XCUIElementTypeStaticText"


33
34
35
# File 'lib/appium_lib_core/ios/xcuitest/search_context.rb', line 33

def self.extend
  ::Appium::Core::Base::SearchContext.add_finders(class_chain: '-ios class chain')
end

Instance Method Details

#ios_class_chain_findObject

Only for XCUITest(WebDriverAgent) find_element/s can be used with a [class chain]( github.com/facebook/WebDriverAgent/wiki/Queries)



33
34
35
# File 'lib/appium_lib_core/ios/xcuitest/search_context.rb', line 33

def self.extend
  ::Appium::Core::Base::SearchContext.add_finders(class_chain: '-ios class chain')
end