Method: WDA::FindElement#statictext

Defined in:
lib/wda_lib/find_element.rb

#statictext(value = 0) ⇒ TextField

Find StaticText by given index or value If value is integer then return the StaticText at that index If value is string then return the first StaticText which contains given value

Parameters:

  • value (String, Integer) (defaults to: 0)

Returns:

  • (TextField)


305
306
307
308
309
310
311
# File 'lib/wda_lib/find_element.rb', line 305

def statictext(value = 0)
  if value.is_a? Numeric
    finds(:xpath, "//XCUIElementTypeStaticText")[value]
  else
    find(:xpath, "//XCUIElementTypeStaticText[@value=\"#{value}\"]")
  end
end