Scripting Hybrid Native/HTML Apps

Scripting Hybrid Native/HTML Apps
MonkeyTalk seamlessly scripts native Android or iOS applications containing embedded HTML web views. HTML elements are handled exactly like native UI components. When executing a command, MonkeyTalk searches all displayed native and web components  until one is found with a matching monkeyId. So for example if your script contains the command:
Button OK Tap
MonkeyTalk will search the currently displayed UI and HTML components until a button with monkeyId "OK" is found.
For HTML elements, monkeyId is derived by searching the following properties in the specified order. The first non-blank value will be recorded. At playback time, the monkeyId will be compared for a match against each of the properties.

  1. id
  2. name
  3. value
  4. text()
  5. title
  6. styleClass2

For example, the application below has a native TabBar component as well as HTML elements displayed in an embedded webview. The script below selects the native tab and then taps an HTML button. There is no need to distinguish between native components and HTML elements. MonkeyTalk component types are mapped to HTML components so that, for example, Button matches both a <Button> tag as well as an <Input type="submit"> tag.

# Select the Native TabBar1
TabBar * Select Web
# Tap the HTML Button
Button "Click Me" Tap