| http://developer.ebay.com/DevZone/XML/docs/WebHelp/DevAndTestApplications-Testing_Applications.html | |
| Getting Started > Developing an eBay-Enabled Application > Testing Applications | |
Testing Applications
Before an application can start operation in the Production environment, it must be fully tested to ensure that it operates in as error free a manner as possible and abides by all API usage rules. To do this testing, eBay provides a special environment called the Sandbox environment (or, the Sandbox for short). In this environment, an application can perform all the same operations it would in the Production environment, except that the users, items, and payment funds involved are all fictitious.
Test users, items, and funds cannot be seen from or used in the Production environment. Conversely, real users, items, and money from the Production environment cannot be seen from or used in the Sandbox environment.
This section provides information and tips for setting up test users and testing applications for special sites (eBay Stores and eBay Motors). See the chapters for individual API calls for testing tips for using specific calls. For example, for information on testing GetAccount in the Sandbox, see Testing GetAccount.
Creating Stores in the Sandbox
Using the Sandbox
Before an application can operate in the Sandbox, the developer must have been issued keys for the Sandbox by the eBay Developers Program).
Using an application in the Sandbox is essentially the same as in the Production environment. The application merely needs to be pointed to the Sandbox environment. See Routing the Request (Gateway URLs) for more information on how to point an application to the Production or Sandbox environments.
The Sandbox duplicates much of the functionality that is on the eBay Web site. It processes API calls in exactly the same manner as the Production environment, and it includes a subset of the eBay site's Web pages. The difference is that all the users are test users (created by developers like you) and all the money exchanged is test money.
Use the Sandbox to experiment with function calls, to prototype new routines, to test your application's business logic, and to make sure your application adheres to eBay's Compatible Application Check Requirements before you apply for the Compatible Application Check.
Before you begin working with the eBay API and before you attempt to connect to the Sandbox, make sure you have all the tools in your local development environment working properly.
The sooner you start using the Sandbox, the sooner you will gain expertise in how to send requests to eBay and how to handle the results that are returned.
Automated Sandbox Test Users
Even before you create your own test users, you can use several automated Sandbox users to facilitate testing. The automated Sandbox users do activities in the Sandbox. Specifically, the automated Sandbox users regularly add items, buy items, pay for items, leave feedback, enter disputes, and engage in other activities. The automated Sandbox users enable you to test many calls, such as AddItem, GetItem, GetBidderList, GetSellerList, GetItemTransactions, GetOrders, GetItemShipping, and GetSearchResults.
The following table contains the usernames and passwords of the automated Sandbox users:
For definitions of the Sandbox and Production environments, see The Sandbox and Production Environments.
Creating a Test User
Testing an application in the Sandbox requires the creation of one or more test users. These users act as the sellers and buyers of items during the testing of an application. The process of "registering" a test user is different than that for registering a real user in the Production environment and should be done on the eBay Developers Program site. To create a test user for application operations in the Sandbox environment, follow the instructions in the Development Tools area on the eBay Developers Program site:
The user name and password you specify for test users is different from the user name and password you use to log in to the eBay Developers Program site. Test user IDs cannot be used to log in to the eBay Developers Program site and your eBay Developers Program ID cannot be used to sell or buy items in the Sandbox.
To test only listing items, an application needs only one test user. But to test both the selling and buying aspects of the application requires at least two test users: one to act as the seller and one to act as the buyer. eBay rules forbid a seller from bidding on his or her own listings, a rule that also applies in the Sandbox. To fully test multi-item listings (Dutch auctions and multi-item fixed-price listings), you should create at least three test users: one seller and two buyers.
While an application might only supply functionality that serves sellers (listing items only, no bidding or purchasing), you should test the effects of buyer actions to ensure that the application handles all of the interactions the application may encounter in production.
In general, even if your application just lists items, you should test it for typical scenarios such as users bidding on items, users winning bids (and calculation of shipping costs), and the non-paying bidder.
If you are creating an application that caters only to buyers, you should have at least one test user designated as a seller. After all, a buyer cannot bid on an item unless a seller listed it.
For test users to perform actions associated with a test run of an application, eBay allots a pre-determined amount of credit (play money) to each test user's account. The accounts are automatically refreshed to $500,000 each weekend. This means you can safely retry listing items individually and in bulk without paying real fees each time on eBay and without any obligation to deliver real items to real buyers.
Also see The Sandbox and Production Environments.
Testing Your Application's API Access
Some API calls have access rules. The rules define how many times an application can use certain API calls each day or hour. Your application also has an aggregate call limit, although not all calls are counted toward the limit.
Your application can detect and report the current API access rules and its current usage with GetApiAccessRules, which shows which API calls have limits, what the limits are, and whether they count toward the aggregate. GetApiAccessRules returns any number of ApiAccessRule objects. Each ApiAccessRule defines a rule, and you can parse for various values.
In your application, you can check for the hourly or daily usage of a specific call, say AddItem. Check your application's API access when you test it in the Sandbox, and also while your application runs on the Production server. Call rate limits are set at the sole discretion of eBay. When your application goes through the Compatible Application Check, your application will be rate-limited on an application basis or a per-user basis, depending on your customer base and distribution format. Application-based call limits mean that your application will have a maximum API call cap on a daily and monthly basis. The user-based call limits mean that each user of your application gets their own pool of API calls. One person's usage does not affect another's, so as many people can use your program as you'd like. To learn more, refer to the Compatible Application Check page on the eBay Developers Program site:
Creating Stores in the Sandbox
If you want to test your application's ability to list items in an eBay Store, you need to set up a storefront in the Sandbox. See Creating a Store.
For conceptual information on eBay Stores, see eBay Stores.
| Getting Started > Developing an eBay-Enabled Application > Testing Applications | |
| http://developer.ebay.com/DevZone/XML/docs/WebHelp/DevAndTestApplications-Testing_Applications.html | |
| © 2004–2008 eBay Inc. All rights reserved. | Version 577 |