If you want to test your application as another user who isn’t a developer, but the Facebook ToS prevents you from creating accounts that aren’t linked to your real identity, use a test account.The Facebook team realized that they were caught in a vicious cycle in which developers were creating fake accounts for testing and the Facebook police were disabling them as fakes, thereby upsetting the developers who then created more accounts, thereby making more work for the police, etc., etc., ad infinitum. Facebook put an end to the problem by giving us the ability to mark an account as a “test account,” which has most of the privileges of a real account but with the notable exception of not being able to see “real” Facebook users or owning Platform applications.
Making a test account is really easy: just create a new Facebook account and then go to http://www.facebook....est_account.php while you’re logged into it. You’ll be shown a confirmation page (Figure 1) that reiterates that any applications owned by this account will be disabled, and you’re one click away from testing nirvana.
This is very strong magic! Be very, very careful. Test accounts are like the Matrix: once you’ve swallowed the red pill (or gone to the URL just listed), there’s no way to go back to living innocently in your pod. Don’t do this step from your primary Facebook account or you’ll have banished yourself into Test Account land.
Here are a few useful tips on using test accounts:
Test accounts can be really handy, but the fact that they can’t own applications (which really means not being registered Developers of an app) means they can’t see apps that are in Developer Mode and therefore can’t be used to test an app that isn’t yet public.
You’ll need a unique email address in order to sign up, but coming up with different addresses for each account can be a pain. If you have a Gmail account, take a look at so-called “dot addressing.” Gmail doesn’t recognize dots inside of your email address, so
<firstname.lastname@example.org>is the same thing as
<email@example.com>, in that they’ll all get delivered to you. Facebook sees them all as different addresses and will let you sign up as different accounts. Gmail also has a much more useful “plus sign addressing” feature in which it ignores everything after a plus sign in your address (so
<firstname.lastname@example.org>is the same as
<email@example.com>), but unfortunately Facebook won’t allow plus signs in emails.
Facebook login sessions persist across all the tabs and windows in your browser through the use of session cookies, but they can’t persist into different browsers. Since you’re a kick-ass web developer and you already test in Firefox, Safari, and IE 6/7/8 on Windows and in Firefox and Safari on Mac, why not log into Facebook with a different test account on each platform? That way you cover different browsers and different users at the same time.
Learn more about this topic from Facebook Cookbook.
This Cookbook gives you a unique collection of recipes for building Facebook applications using the new profile design. This easy-to-follow book not only gives you practical ways to design and build scalable applications using the Facebook Platform, it also offers strategies for successfully marketing them in this highly competitive environment. Learn what it takes to design Facebook applications that stand out among the thousands already available.