App Tester User Guide

The App Tester tool enables you to test Amazon In-App Purchasing (IAP) features before publishing your app to the Amazon Appstore. Once you have downloaded, installed, and set up the App Tester tool, you can start testing purchasing features in your app.

If you have not already set up the App Tester for your app, see Install and Configure App Tester.

Choose the IAP API

When you first launch the App Tester App, the landing page prompts you to choose the IAP API:

Tap the In-App Purchasing API prompt to begin. 

The App Tester displays a list of navigation options for IAP API:

  1. User Account Settings: Configure the user test accounts for your app.
  2. API Response Settings: Configure the conditions and responses for your test cases.
  3. Notification Settings: Enable or disable the notifications that are added to the notification drawer.
  4. Manage Transactions: Manage the active IAP transactions for your app.
  5. IAP Items in JSON File: View the data that you added to the App Tester from your JSON file in an easily human-readable format.

Manage Users

You can log a user in and out, change users, and change the market place associated with a user. These options facilitate testing different scenarios with different users in different marketplaces.

To access the user management screen, select the IAP API from the App Tester landing page, then tap User Account Settings.

Log in and out

To toggle the current user between being logged in and logged out, under Status tap the Logged in or Logged Out option.

Change the current user

App Tester provides three different test user accounts. Test users are named Amazon User 1, Amazon User 2, and Amazon User 3.

To change users, look under Amazon User Id, and select the user Id that you want to use for testing.

Change user marketplace for the current user

App Tester provides you with the ability to test your app in different international markets. To change the market place associated with the current user, look under User Marketplace and select a new market. The following markets are available:

  • US: United States of America
  • GB: Great Britain
  • DE: Germany
  • ES: Spain
  • FR: France
  • IT: Italy
  • JP: Japan

Configure API Response Settings

Use the API Response Settings tab to set the conditions and responses for your test calls to the IAP API:

When specifying a response, “Default” in the following sections simply means to use the existing default settings. “Default” is not an available setting itself. If you explicitly select a value, such as SUCCESSFUL or FAILED, the App Tester will return the selected value. For example, getProductData will return SUCCESSFUL if the JSON file contains the requested SKU. GetUserData will return FAILED if the user is set to Logged Out in User Account Settings.

The following table shows the available responses for the IAP APIs.

API Name Available Responses
GetProductData Default, SUCCESSFUL, FAILED
GetPurchaseUpdates Default, SUCCESSFUL, FAILED
GetUserData Default, SUCCESSFUL, FAILED
Purchase Default, SUCCESSFUL, FAILED, ALREADY_PURCHASED, INVALID_SKU

Enable or Disable Your Notifications

Use the Notifications Settings tab to easily enable or disable the notifications that are added to the system’s notification drawer.

The following image shows the Notification Settings tab:

The following notification settings are available:

  • Purchase Updates Notifications: By default, Amazon sends a notification when an app loads a purchase dialog but has never called getPurchaseUpdates().  Amazon stops sending this notification after the app calls getPurchaseUpdates() once. Use the Purchase Updates Notifications setting to toggle whether Amazon ever sends this notification.

  • Notify Fulfillment Notifications: By default, Amazon sends a notification if a user makes a purchase and the item is not fulfilled within 30 seconds. Use Notify Fulfillment Notifications to toggle this notification on or off.

  • Reset Purchase Updates: Resets the state indicating whether or not getPurchaseUpdates() has been called.

Manage Transactions

Use the Manage Transactions tab to view, cancel, and delete purchase transactions for the current user. Cancelling and deleting transactions are helpful tools when testing entitlements and subscriptions. This tab displays all transactions for the current user.

The Manage Transactions tab contains the following information for each transaction:

  • RECEIPT: Type of product purchased. Valid values for IAP are CONSUMABLE, ENTITLEMENT, and SUBSCRIPTION.
  • RECEIPT ID: Unique identifier for the transaction.
  • SOLD BY: App that sold the item.
  • PURCHASED ON: Date that the item was purchased.
  • STATUS: Transaction status. Valid values are PURCHASED or CANCELED. These App Tester values map to the IAP API values FULFILLED and UNAVAILABLE, respectively.

When an app calls PurchasingService.notifyFulfillment(receiptId, FulfillmentResult.FULFILLED, the receipt shows up in the Manage Transactions section with status: FULFILLED.

 From the Manage Transactions tab, you can perform the following tasks:

  • Refresh the list of transactions for the current user.
  • Delete all transactions for the current user.
  • Cancel an individual transaction.
  • Delete an individual transaction.

View the IAP Items in Your JSON File

To provide an easy way to view the IAP items in the JSON file that you configured in Installing and Configuring the App Tester, tap the IAP Items in JSON File tab. If you have correctly added a valid JSON file, the App Tester will parse and display the contents of the file under this tab.

If you have not correctly added a valid JSON file, this tab will either display an error message or will specify that the JSON file does not exist.

Simulate Your Users’ Experience

In addition to providing responses to API requests, the App Tester can display purchase flow dialogs, just like a live, published app does. The benefit of this feature is that the dialogs can help you to evaluate the user experience for your app’s purchase process.

App Tester displays two interstitial dialogs for each Purchase Request. The first dialog is a detail page dialog that shows the purchase price and other details, as shown in the following IAP example:

The second dialog is a “thank you” page that a user must manually close by tapping the “X” button in the upper right-hand corner, as shown in the following IAP example:

Logging

AppTester uses the Logcat tool to capture details about your app’s transactions and other API interactions. To use Logcat to view the logs generated while testing your app:

  1. Connect the Android device with your app and AppTester to a computer running Android Debug Bridge (ADB).
  2. Search for the tag “AmazonAppTester” to view the AppTester log entries.

If you are using the Eclipse DDMS development environment, you can filter App Tester generated log entries by entering tag:AmazonAppTester into the filter text area in the Logcat tab.