-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Description
Move
ruby_lib_core/lib/appium_lib_core/common/base/search_context.rb
Lines 58 to 99 in 589bfa0
| # @example Find element with each keys | |
| # | |
| # # with accessibility id. All platforms. | |
| # @driver.find_elements :accessibility_id, 'Animation' | |
| # @driver.find_elements :accessibility_id, 'Animation' | |
| # | |
| # # with base64 encoded template image. All platforms. | |
| # @driver.find_elements :image, Base64.strict_encode64(File.read(file_path)) | |
| # | |
| # # For Android | |
| # ## With uiautomator | |
| # @driver.find_elements :uiautomator, 'new UiSelector().clickable(true)' | |
| # ## With viewtag, but only for Espresso | |
| # ## 'setTag'/'getTag' in https://developer.android.com/reference/android/view/View | |
| # @driver.find_elements :viewtag, 'new UiSelector().clickable(true)' | |
| # # With data_matcher. The argument should be JSON format. | |
| # @driver.find_elements :data_matcher, { name: 'hasEntry', args: %w(title Animation) }.to_json | |
| # | |
| # # For iOS | |
| # ## With :predicate | |
| # @driver.find_elements :predicate, "isWDVisible == 1" | |
| # @driver.find_elements :predicate, 'wdName == "Buttons"' | |
| # @driver.find_elements :predicate, 'wdValue == "SearchBar" AND isWDDivisible == 1' | |
| # | |
| # ## With Class Chain | |
| # ### select the third child button of the first child window element | |
| # @driver.find_elements :class_chain, 'XCUIElementTypeWindow/XCUIElementTypeButton[3]' | |
| # ### select all the children windows | |
| # @driver.find_elements :class_chain, 'XCUIElementTypeWindow' | |
| # ### select the second last child of the second child window | |
| # @driver.find_elements :class_chain, 'XCUIElementTypeWindow[2]/XCUIElementTypeAny[-2]' | |
| # ### matching predicate. <code>'</code> is the mark. | |
| # @driver.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 | |
| # @driver.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" | |
| # | |
| # rubocop:enable Layout/LineLength |
Metadata
Metadata
Assignees
Labels
No labels