Skip to content

Instantly share code, notes, and snippets.

@JaniJegoroff
Created May 17, 2016 18:56
Show Gist options
  • Save JaniJegoroff/5a3981b107b8c76e2fad94edd2351ad0 to your computer and use it in GitHub Desktop.
Save JaniJegoroff/5a3981b107b8c76e2fad94edd2351ad0 to your computer and use it in GitHub Desktop.
How to capture photo with Google camera using AndroidViewClient
1. Install AndroidViewClient: https://github.com/dtmilano/AndroidViewClient/wiki
2. Implement python script that touches button by id
3. Execute python script from your Appium or Calabash test script
#! /usr/bin/env python
from com.dtmilano.android.viewclient import ViewClient
id = 'com.android.camera2:id/shutter_button' # Google camera capture button
vc = ViewClient(*ViewClient.connectToDeviceOrExit())
vc.findViewById(id).touch()
`python capture_photo.py`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment