Method: Appium::Android#last_button

Defined in:
lib/appium_lib/android/element/button.rb

#last_buttonBUTTON

Find the last button.

Returns:



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/appium_lib/android/element/button.rb', line 59

def last_button
  # uiautomator index doesn't support last
  # and it's 0 indexed
  button_index = tags(BUTTON).length
  button_index -= 1 if button_index.positive?
  image_button_index = tags(IMAGE_BUTTON).length
  image_button_index -= 1 if image_button_index.positive?

  find_element :uiautomator,
               _button_visible_selectors(button_index: button_index,
                                         image_button_index: image_button_index)
end