Skip to content

Instantly share code, notes, and snippets.

@JaniJegoroff
Last active August 29, 2015 14:18
Show Gist options
  • Save JaniJegoroff/4500c8c392004c0adff7 to your computer and use it in GitHub Desktop.
Save JaniJegoroff/4500c8c392004c0adff7 to your computer and use it in GitHub Desktop.
calabash-android - touching button by id outside of your app
One possible solution to an issue discussed here: https://groups.google.com/forum/#!topic/calabash-android/7AhqqC1dyvY
1. Install AndroidViewClient: https://github.com/dtmilano/AndroidViewClient/wiki
2. Implement python script that touches button by id
3. Execute python script from your Calabash test script
`python touch-button.py`
#! /usr/bin/env python
from com.dtmilano.android.viewclient import ViewClient
vc = ViewClient(*ViewClient.connectToDeviceOrExit())
id = 'com.company.app:id/action_favourite' # full id
button = vc.findViewById(id)
button.touch()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment