FANDOM




StrategiesEdit

Name Methods
class name android.widget.EditText
css selector SUPPORTED
id user_name
link text NOT SUPPORTED
partial link text NOT SUPPORTED
tag name
  • username
xpath
  • element(s)ByXPath
dynamic
  • mobile: find

ANDROID ONLY

NOT SUPPORTED

resolve id ANDROID ONLY
xmlKeyContains
  • mobile: xmlKeyContains

ANDROID ONLY

xmlValueContains
  • mobile: xmlValueContains

ANDROID ONLY

Examples

  • element(s)ByName
el = driver.elementByName('Back')
els = driver.elementsByName('Back')
  • element(s)ByTagName
el = driver.elementByTagName('tableView')
els = driver.elementsByTagName('tableView')
  • element(s)ByXPath
el = driver.elementByXPath('cell//button')
els = driver.elementsByXPath('button[@name='Rounded']')

Android OnlyEdit

  • mobile: find
    • This command takes two options:  "all" (return all elements found) and "scroll" (scroll to the element, and then return it).  If all is passed in, it must be on the top list.
driver.execute("mobile: find", [ "all", ["scroll", 3, "views", 7, "views"] ])
driver.execute("mobile: find", [ ["scroll",3, "views",7, "views"] ])
  • mobile: xmlKeyContains
driver.execute("mobile: xmlKeyContains", [])
  • mobile: xmlValueContains
driver.execute("mobile: xmlValueContains", [])

iOS OnlyEdit

  • mobile: findAndAct
opts = {strategy: 'tag name', selector: 'cell', action: 'name'}
driver.execute("mobile: findAndAct", [opts])
  • mobile: findElementNameContains
driver.execute("mobile: findElementNameContains", [{name: 'uses of UIButton'}])