Canopy.Mobile


Selectors

canonpy.mobile supports all Appium selectors and adds some conventions on top that allow easier access.

Finding elements by id

The # sign allows to find elements by it's resource-id.

1: 
find "#MyElementID"

Finding elements by text

canopy.mobile provides conventions to find elements when the displayed text of an element is known.

1: 
2: 
3: 
find "tv:Some displayed text" // looks for textviews with the text
find "edit:Some entered text" // looks for edit fields with the text
find "some text" // looks for any element with the text

Selector functions

find

Returns the first element that matches the given selector.

1: 
find "tv:Test"

findAll

Returns a list with all elements that matches the given selector.

1: 
findAll "tv:Test"

nth

Gets the nth element with the given selector. Index starts at 1.

1: 
nth "tv:Test"

first

Gets the first element with the given selector.

1: 
first "tv:Test"

last

Gets the last element with the given selector.

1: 
last "tv:Test"
Fork me on GitHub