Testing your Facebook Connect app using Selenium?

Does anyone have experience using Selenium to automate testing a web application using Facebook Connect to log in a user? Any tips or techniques you recommend?

+5
facebook selenium selenium-rc automated-tests
source share
1 answer

Depends on what you want to do?

  • Will you use a real Facebook user (which is verified by phone through Facebook)?

    The safest and most reliable, but very difficult (impossible) collection of "real" users (phone confirmed by FB).

    In terms of defining aspects of user / relationship information such as education history, work history, name, age, etc. (especially if you donโ€™t have access to all your โ€œrealโ€ facebook accounts).

  • Fake facebook users created to test an application (not confirmed by Fb)?

    Perhaps the easiest way to set it up, since everyone is a fake user, does not require checking the phone (with FB). But you need to create email identifiers for all users.

    Although the connection information can be customized to your liking. One of the main drawbacks (and this happened to me), if Fb discovers that the user is not legal, FB will freeze all accounts. This would make all of your automated Fb tests for the user useless in no time. And you canโ€™t do much (if you do not plan to get a completely new telephone connection to check these accounts, neither google, skype, nor ip phones are allowed. FB is very strict with this). Also, one number can only allow 1 account.

  • Will you use the Facebook API to create Fb testing users?

    Perhaps the ideal way (according to the FB) is to use Facebook to test your application. Click here for documentation on how to use it.

    It may seem straightforward, but it has its downfalls (major). Very unjustifiably, the API returns an error in 10-20% of cases, and extremely slows down other times. It is not possible to get the user password for the FB test if it is set incorrectly. Connection information cannot be easily configured. It takes a lot of effort to configure it, not being sure that it works every time.

I personally chose the second option. Facebook detects the legitimacy of the user (I think) based on concurrent logins in several IPs. I have selenium RCs running on different servers that run these tests in parallel, which could raise a red flag. Therefore, I simply plan these scenarios in a more organized way to avoid overlapping entries.

Hope you find your answer in this long explanation. :)


To implement perl -

$sel->start(); $sel->open_ok("$URL"); $sel->set_speed("500"); $sel->click_ok("//img[\@alt='Facebook']",'User clicks on Facebook Login'); $sel->wait_for_pop_up_ok("", "30000",'Facebook Login Popup Loading'); $sel->select_pop_up("null"); $sel->type_ok("email", "email\@email.com",'User enters Facebook credentials - Username'); $sel->type_ok("pass", "password",'User enters Facebook credentials - Password'); $sel->key_press("pass", "\\13",'User returns Facebook Login credentials'); $sel->select_window("null"); 
+1
source share

All Articles