So, cross platform means Sencha right?
Que 1:-
Yes, Appium support to hybrid as well as native iOS/Android app.
for automation you can reuse same code for both iOS and Android(But take it with pinch of salt).
Please see 6th answer here
Check out this github link https://github.com/appium/appium.
Que 2:-
Locating elements :-
you can use indexes, resource_id, text, and XPath also.
1. Indexes :- Suppose you want to get index of buttons. Appium treat specific types of elements as array.
Start counting of indexes(button[0],button1 ... ) from top to bottom, left to right.
- uiautomatorviewer :- connect you mobile device to desktop and launch your app.
In desktop terminal use
uiautomatorviewer
command (please make sure you have all ANDROID_HOME path set for tools, platform-tools, build-tools and adb devices
showing all attached devices list).
It will open a window, click on right most take a screenshot button. Hover on elements present on screenshot you will see all elements by indexes, resource_id, text, and XPath
limitations :- Appium is Little bit unstable till now.
Android 4.2+ supports to uiautomatorviewer
while for lower version use Selendroid
for cross platform you need to change code capabilities
based on your platform(iOS/Android) and device version and running platforms.
See blog for help http://swapnilvkotwal.wordpress.com/2014/04/04/appium-setup-ruby-sample-test-script/