测试使用Selenium一个Facebook Connect应用程序? [英] Testing a Facebook Connect application using Selenium?

查看:241
本文介绍了测试使用Selenium一个Facebook Connect应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人有经验,使用Selenium自动化使用Facebook连接用户登录web应用程序的测试?任何提示或方法,你建议?

Does anyone have experience using Selenium to automate testing of a webapp that uses Facebook Connect for user login? Any tips or methods that you recommend?

推荐答案

取决于你想要做什么?

Depends what you want to do?


  1. 您将使用一个真实的真正的Facebook用户(这是手机被Facebook验证)?

  1. Will you be using a real-real Facebook User (which is phone verified by Facebook)?

最安全,最可靠的,但非常困难(的无法的)收集真正的用户(通过电话核实FB)。

Safest and most reliable ,but very difficult (impossible) to gather "real" users (phone verified by FB).

在定义用户/连接的详细信息,如教育的历史,工作经历,姓名,年龄等方面的条款(特别是如果你没有访问所有真正的Facebook账户)。

In terms of defining aspects of the user/connections details, like education history, work history, name, age etc(specially if you do not have access to all the "real" facebook accounts).

用于测试应用程序(而不是由Fb的验证)创建虚假的Facebook用户?

Fake facebook users created for testing the app (not verified by Fb)?

也许最简单的设置,因为所有都是假的用户,无需电话验证(FB)。
但对于所有用户的电子邮件ID将需要创建。

Probably the easiest to setup, as all are fake users, no Phone verification(with FB) required. But email ids for all users would need to be created.

即使连接信息可以根据自己的喜好。一个主要的缺点(它发生在我),是如果Fb的检测使用者是不合法的,FB将冻结的所有帐户。这将使所有Fb的 用户特定的自动测试在一眨眼的功夫都没用。并没有什么可以做(除非你打算得到一个全新的手机连接,以验证这些帐户,没有谷歌数字,没有的Skype,没有基于IP电话允许的。FB是非常严格与)。另外一个号码可以授权仅1帐户。

Even though the connection info can be tailored to your liking. One of the main drawbacks(and it has happened to me), is if Fb detects the user is not legit, FB would freeze all accounts. Which would make all your Fb user specific automated tests all useless in the blink of an eye. And there is not much you can do(Unless you plan to get a brand new phone connection to verify those accounts, no google number, no skype, no ip based phones allowed. FB is very strict with that). Also one number can authorize only 1 account.

将您使用Facebook的API来创建Fb的测试用户?

Will you be using the Facebook APIs to create Fb test users?

大概是理想的方式(根据FB)使用Facebook Connect来测试您的应用。点击这里关于如何使用它的文档。

Probably the ideal way (according to FB)to use Facebook connect to test your app. click here for documentation on how to use it.

它可能看起来直线前进,但它具有其挫折(主要的)。非常不relaible,API返回一个错误的时间10-20%,而其他时间的极端放缓。如果一旦错位没办法检索FB测试用户的密码。连接信息不能轻易定制。 ,必须经过相当数量的设置它的东西没有被确认它每次工作。

It may seem straight forward, but it has its downfalls(major ones). Very un-relaible, the API returns an error 10-20% of the time, and extremly slow the other times. No way to retrieve the password of a FB test user if misplaced once. Connection info cannot be easily customized. A fair amount of effort required to set it up something without being sure it work each time.

我亲自选择了第二个选项。 Facebook的检测用户(我猜)的基础上跨越多个IPS并行登录的合法性。我在不同的服务器,这在并行运行这些测试,这本来可能是举着红旗运行硒雷达散射截面。所以,我只是在安排更有组织的方式这些脚本,从而避免登录重叠。

I have personally opted for the second option. Facebook detects the legitimacy of the user (I guess) based on parallel logins across multiple ips. I have selenium RCs running across various servers, which run these tests in parallel, which could have possibly raised a red flag. So i just schedule these scripts in a more organized manner, so as to avoid login overlaps.

我希望在这漫长的解释,你找到答案。 :)

I hope in this long explanation you find your answer. :)

有关perl的实现 -

For the perl implementation -

$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");

这篇关于测试使用Selenium一个Facebook Connect应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆