title: How can I programmatically click on "Buy" button in automated Android in-app billing testing
body: <p>I am writing automated testing code (using <em>ActivityInstrumentationTestCase2</em>) to test an app that involves in-app billing version 2 (subscriptions). I need help on figuring out how to programmatically get my testing code to click on the "Accept and Buy" button that appears inside the "<strong>Pay with credit card/Secured by Google Wallet</strong>" dialog which is supposedly created by some Google SDK code.</p>
  
  <p>I can get the testing code to click on other buttons that are created by my own code/acitivty, usually by accessing the buttons from its parent activity or view, and then call the <code>.performClick()</code> method on the button. But this "Buy" button is not reachable from any activities as far as I know. </p>
  
  <p>It appears this dialog may be created by <code><code>com.google.android.finsky.activities.IabActivity</code> </code> based on the logcat output. I used an ActivityMonitor watching this activity, but it was never triggered. If you can help either directly, or point me to the relevant Google SDK source code that's responsible for creating the "Pay with credit card" dialog or the source for the <code>com.google.android.finsky.activities.IabActivity</code> class, I'd be very grateful.</p>