I've tried registering test accounts to test facebook likes on my site, but running tests repeatedly flags the accounts as spam. Facebook allows fake users for FB apps, but not external apps.

Are there any workarounds? How do you do do selenium testing on facebook?

  • So you really aren't "testing facebook likes" here, right? You are just trying to ring up a ton of likes using automation? – Joe Strazzere Jul 6 '13 at 15:08
  • 1
    I'm with Joe. Facebook tests Facebook. They have some of the best Webdriver testers working for them. You don't need to waste time "testing" it. In this context, you ARE a bot and should be flagged. – Bruce McLeod Jul 28 '13 at 23:16
  • 1
    I disagree with the suggestion that I'm trying to test Facebook. The happy path case is to ensure a product can be shared on Facebook, not that Facebook received the request. There are many things that can go wrong along the way. It could point to the wrong product, the iframe could be broken, or there could be issues coming from http vs https. Recently we've had problems with Pinterest blocking our URL shortener. Historically, we've had configuration mistakes that prevented people from sharing on facebook. Writing it off as "testing Facebook" is an oversimplification of a complex system. – Justin Jul 29 '13 at 11:52

It seems to me that you are trying to test Facebook API along with your site. Think of it this way: your site has to load "like" button and make sure that HTTP request is sent once a user clicks on it. That's the responsibility of your site. Facebook part is to process this HTTP request and generate updates to a news feed or whatever. Now, imagine that your test finds a button, clicks on it, request is sent, but news feed is not updated. Is the problem with your site here? Or with Facebook? Is the purpose of a test to find problems in Facebook API and notify their customer support team?

If I were you, I would concentrate on responsibilities of your site. A question comes up, "How would one make sure that HTTP request is being sent without actually sending it, so that your test account is not blocked?" Well, one option you have is to use HTTP proxy from your test and set it up to intercept requests to Facebook. Take a look at http://fiddler2.com/fiddlercore, it should be possible to achieve with this library.

|improve this answer|||||
  • You're right, I suppose the only solution is to narrow the scope of the test. Unfortunately that doesn't give much confidence. As this is a functional test, there are many more points of failure than just our site. And I would like to know as soon as possible if any part of the system is broken. It's a shame Facebook really only acknowledges the development community for their own apps even though their platform extends well beyond that. – Justin Jul 8 '13 at 16:03

In order to follow their terms of use, you don't. If you're not following their terms of service then they can and will do anything within their means to stop what you're doing including flagging things as spam, disabling accounts, etc.

Your best bet (although still doubtful that they would agree) if you have a legitimate business case for doing it would be to contact facebook and let them know your intentions. If you are liking your app or other pages with a test user, it makes sense for them to mark those as spam because someone could write some automation to bloat their likes or shares with fake ones and they don't want to allow that.

|improve this answer|||||
  • I accept that there's no way to do functional testing as a fake user, i.e. clicking through the actual user flow. I was looking for something more along the lines of click like and check to see if the request was successfully sent. – Justin Jun 20 '13 at 17:49
  • There is a way of testing as a fake user. Let me add a walkthrough, the steps involved are pretty dumb. EDIT: I'm dumb, I didn't see this was an external application. ::facepalm:: – AlbertEngelB Jun 20 '13 at 19:05
  • I would guess that anything you do via a developer API key is probably going to be allowed. So, if you are performing the "like" via your developer account (i.e. webservice), it seems like they would allow it wouldn't they? – djangofan Jun 20 '13 at 19:55
  • Facebook is trying to protect itself against "bots" that drive up the likes for specific pages or apps. If people can create a bot that increases the likes for their page or app then users would stop trusting that data. That's why Facebook is so aggressive about marking it as spam. – Sam Woods Jun 20 '13 at 23:28
  • 1
    Considering their entire business model relies around having an accurate representation of what people like and don't like, it makes sense why they're so adamant about making it right. – corsiKa Jun 24 '13 at 17:21

Try to use Facebook test users + http://code.google.com/p/facebook-test-java-api/ (or something like this if you don't use selenium with java). With moderate (i.e not load-testing like) numbers of test user you will be never flagged as a spammer.

|improve this answer|||||
  • Per the discussion above, Facebook only supports test users on Facebook apps. We have a non-Facebook app. – Justin Jul 28 '13 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.