如何设置 Selenium RC 来测试互联网上的任何网站?
我是使用 Selenium 的新手。
Selenium IDE 是一个用户友好的 Firefox 插件。我使用起来没有任何问题。然而,我发现其他 Selenium 工具(例如 Selenium RC 和 Selenium Core)的文档对于初学者来说相当混乱。作者似乎假设读者已经对使用这些工具有了深入的了解。
例如,当我尝试弄清楚如何设置 Selenium RC 来测试网络服务器时,我可以从 Selenium 网站找到的唯一图表是:
http://www.sparksupport.com/blog/wp-content/uploads/2010/11/selenium-rc.png
从这张图中,我什至看不出哪一个是正在测试的网络服务器以及我应该在哪里安装 Selenium 组件。
起初我认为这个图有点奇怪,我应该能够从其他网站获得更好的图。我惊讶地发现互联网上几乎所有 Selenium RC 设置图都与此图相似(克隆)。没有人尝试创建不同的图表或为 Selenium RC 设置提供更多描述。
如果有人能给我有关如何设置 Selenium RC 的指导,我将不胜感激。我想知道的是:
- 我可以使用 Selenium RC 来测试互联网上的任何网站吗?
- 如何设置 Selenium RC?
- 我当前的设置正确吗?我当前的设置是这样的:在可以访问互联网的 LAN 网络中,我有 3 台服务器。 Server-1 附带 IE8,Server-2 附带 Firefox 3.6。 Server-3 将用作 Selenium RC 服务器。因此,server-3中的Selenium RC将远程控制server-1和server-2来启动IE和FF。 Server-1 和 Server-2 将使用 server-3 作为 HTTP 代理来连接到 Internet 上的任何 Web 服务器。如果我想测试像yahoo.com这样的网站,我可以编写Selenium脚本并让它在Server-3中运行来控制server-1和2中的IE和FF。
I'm new in using Selenium.
Selenium IDE is a user-friendly firefox plugin. I have no problem in using it. However, I found that the documentation for other Selenium tools such as Selenium RC and Selenium Core is quite confusing for beginners. It seems that the author assume that the readers already have deep knowledge in using these tools.
For example, when I try to figure out how to setup Selenium RC to test a webserver, the only diagram i can find from the Selenium website is this:
http://www.sparksupport.com/blog/wp-content/uploads/2010/11/selenium-rc.png
From this diagram, i can't even see which one is the webserver under test and where should i install the Selenium components.
At first I thought this diagram is a bit weird and i should be able to get a better diagram from other websites. I was surprised to find that almost all Selenium RC setup diagram on the internet are similar to this diagram (clones). No one has ever attempted to create a different diagram or give more description for Selenium RC setup.
Appreciate if anyone can give me guidance on how to setup Selenium RC. The things that i want to know are:
- Can i use Selenium RC to test any website on the Internet?
- How to setup Selenium RC?
- Is my current setup correct? My current setup is like this: In a LAN network which has access to the Internet, I have 3 servers. Server-1 comes with IE8, Server-2 comes with Firefox 3.6. Server-3 will be used as the Selenium RC server. So, Selenium RC in server-3 will remotely control server-1 and server-2 to start up IE and FF. Server-1 and 2 will use server-3 as the HTTP proxy to connect to any webserver on the Internet. If I want to test a website such as yahoo.com, I can write Selenium script and let it run in Server-3 to control the IE and FF in server-1 and 2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此信息与 Selenium 1 相关。
Selenium 系统由 3 部分组成:
如果您提供用于测试的语言和其他技术细节,将会很有帮助。
关于您的问题:
仅供参考 - 您可以在一台 PC 上一起运行
This info is related to Selenium 1.
Selenium system consists of 3 parts:
It will be helpful if you provide language that you use for your tests and other technical details.
About your questions:
FYI - you can run all together on one PC
下图是我在许多场合实现的 Web 应用程序测试系统。这并没有向您展示安装 Selenium RC 的具体细节,但它确实在高层次上向您展示了所有必要的系统组件以及它们的接口方式。
我们希望您可以使用它来了解如何使用 Selenium、MySQL 和 Perl 等开源解决方案来实现您自己的系统。
我们的团队明白,并非所有网站都是平等创建的,为了使任何自动化计划取得成功,不仅必须对 Web 应用程序进行彻底分析,还必须对业务进行彻底分析。由于我们客户的 QA 团队虽然精通技术,但不是程序员,因此我们决定实现一种页面对象设计模式,其中所有“神奇的 selenium 命令”都被抽象在一个类中,并作为测试开发人员从测试中调用的方法公开给测试开发人员脚本。
由此产生的实现(如下图所示)目前正在部署,并使管理层和相关方了解网站关键功能区域的最新状态。
系统图 - 点击查看
在接下来的几周内,我们将更详细地介绍每个实施步骤。我们期待任何反馈!
网络和移动自动化博客
The below diagram is of a web application test system that I've implemented on numerous occassions. This does not show you specifically details on installing Selenium RC, but it does show you, at a high level, all of the necessary system components and how they interface.
We hope you can use it to get ideas on how to implement your own systems using open source solutions like Selenium, MySQL and Perl.
Our team understands that not all web sites are created equal, and, in order for any automation initiative to be successful a thorough analysis must be performed of not only the web application, but the business as well. Since our client's QA team, while technically savvy, were not programmers we decided to implement a page object design pattern where all of the "magical selenium commands" were abstracted in a class and exposed to the test developers as methods they would call from their test scripts.
The resulting implementation, as seen in the diagram below, is currently deployed and keeping management and interested parties up to date on the status of key functional areas of the web site.
System Diagram - Click to View
In the coming weeks, we are going to be covering each implementation step in more detail. We look forward to any feedback!
Web and Mobile Automation Blog